Support #7559: Memory check issues for Sirius A
SimpleMemoryChecker needs to be able to cope with different procfs formats on different SLF versions.
Chris Jones reported thusly:
Are you providing the SimpleMemoryCheck service to your clients? If so, check the definition of linux_proc you are using. I just discovered that the types and even some of the fields do not match the present description of the linux proc file system. I'm guessing there was a change from SL4 to SL5 and we never caught the difference since VSize and RSS remained at their same location in the format.
Thought you should know,
We need to find out what changed between SLF4 and SLF5 (and potentially between SLF5 and SLF6), how to detect the changes and then act accordingly.
#6 Updated by Kyle Knoepfel over 5 years ago
- % Done changed from 0 to 70
The procfs types and fields for
SLF6 are shown below. Entries prefaced with '
*' indicate either a difference in type or field.
Property SLF5 SLF6 ======================================= 1. pid %d %d 2. comm %s %s 3. state %c %c 4. ppid %d %d 5. pgrp %d %d 6. session %d %d 7. tty_nr %d %d 8. tpgid %d %d * 9. flags %lu %u 10. minflt %lu %lu 11. cminflt %lu %lu 12. majflt %lu %lu 13. cmajflt %lu %lu 14. utime %lu %lu 15. stime %lu %lu 16. cutime %ld %ld 17. cstime %ld %ld 18. priority %ld %ld 19. nice %ld %ld 20. num_threads %ld %ld 21. itrealvalue %ld %ld *22. starttime %lu %llu ---------------------------------------- 23. vsize %lu %lu 24. rss %ld %ld ---------------------------------------- *25. rlim %lu --- *25. rsslim --- %lu 26. startcode %lu %lu 27. endcode %lu %lu 28. startstack %lu %lu 29. kstkesp %lu %lu 30. kstkeip %lu %lu 31. signal %lu %lu 32. blocked %lu %lu 33. sigignore %lu %lu 34. sigcatch %lu %lu 35. wchan %lu %lu 36. nswap %lu %lu 37. cnswap %lu %lu 38. exit_signal %d %d 39. processor %d %d *40. rt_priority %lu %u *41. policy %lu %u 42. delayacct_blkio_ticks %llu %llu *43. guest_time --- %lu *44. cguest_time --- %ld
For the current memory service, only items 23 and 24 are of interest. The code is being restructured so that only the values of fields 23 and 24 are stored. This is done by a new function that looks like:
vsize_t vsize; rss_t rss; std::istringstream iss ( buffer_from_proc_stat ); iss >> token_ignore(22) >> vsize >> rss;
Should a user decide they want the values associated with any other fields, we will need to come up with an SL-release-dependent way of handling this. For now, this is not a concern.
The types of
rss in the current version of
SimpleMemoryCheck_service.cc are being corrected to be in accord with those provided by