Introduction
- RDK PROC ANALYZER is a tool that enables different teams like development, triage and testing to analyze the CPU and memory utilization of the processes that run on top of RDK framework.
- It helps us in detecting the memory leaks, cpu and memory performance regressions.
- This tool is implemented as a service.
- Highly configurable (Parameters like period , time interval and processes to be monitored can be configured).
Code Flow
- The main code flow of CPU Procanalyzer -
eyJleHRTcnZJbnRlZ1R5cGUiOiIiLCJnQ2xpZW50SWQiOiIiLCJjcmVhdG9yTmFtZSI6IlVua25vd24gVXNlciAoeW1haGFyYW5hKSIsIm91dHB1dFR5cGUiOiJibG9jayIsImxhc3RNb2RpZmllck5hbWUiOiJVbmtub3duIFVzZXIgKHltYWhhcmFuYSkiLCJsYW5ndWFnZSI6ImVuIiwidWlDb25maWciOiJ7fSIsImRpYWdyYW1EaXNwbGF5TmFtZSI6IiIsInNGaWxlSWQiOiIiLCJhdHRJZCI6IjE0NDkwMDc3MCIsImRpYWdyYW1OYW1lIjoiTUFJTiBDT0RFIEZMT1cuZHJhd2lvIiwiYXNwZWN0IjoiIiwibGlua3MiOiJhdXRvIiwiY2VvTmFtZSI6ImNwdXByb2NhbmFseXplciIsInRic3R5bGUiOiJ0b3AiLCJjYW5Db21tZW50IjpmYWxzZSwiZGlhZ3JhbVVybCI6IiIsImNzdkZpbGVVcmwiOiIiLCJib3JkZXIiOnRydWUsIm1heFNjYWxlIjoiMSIsIm93bmluZ1BhZ2VJZCI6OTAxMTcyMzQsImVkaXRhYmxlIjpmYWxzZSwiY2VvSWQiOjkwMTE3MjM0LCJwYWdlSWQiOiIiLCJsYm94Ijp0cnVlLCJzZXJ2ZXJDb25maWciOnsiZW1haWxwcmV2aWV3IjoiMSJ9LCJvZHJpdmVJZCI6IiIsInJldmlzaW9uIjoxLCJtYWNyb0lkIjoiMmIyYzI3ZDUtZWU1Mi00NWU0LWI4NWQtMDQyNzM5MjQ1ODkwIiwicHJldmlld05hbWUiOiJNQUlOIENPREUgRkxPVy5kcmF3aW8ucG5nIiwibGljZW5zZVN0YXR1cyI6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VudC5kcmF3aW8ucG5nIiwibGljZW5zZVN0YXR1cyI6Ik9LIiwic2VydmljZSI6IiIsImlzVGVtcGxhdGUiOiIiLCJ3aWR0aCI6Im51bGwiLCJzaW1wbGVWaWV3ZXIiOmZhbHNlLCJsYXN0TW9kaWZpZWQiOjE2MTQ2OTQ1NDYwMDAsImV4Y2VlZFBhZ2VXaWR0aCI6ZmFsc2UsIm9DbGllbnRJZCI6IiJ9
How to Launch
This tool runs as a service.
If the file /tmp/PROC_ANALYZER_ENABLE is touched the tool starts running and it logs the details.
How to Configure:
1 Open ‘/opt/rmfconfig.ini’ file on the device.
Parameters that can be configured:
(a)Time Interval
(b)Period
(c)Enable Dynamic
It would take the default values if not configured (sleepsecs:60, Time to run:0, Dynamic:1)
Ex: FEATURE.CPUPROCANALYZER. SLEEP.SECS=60
FEATURE.CPUPROCANALYER.TIMETORUN.SECS = 0 (which means tool runs until it is killed manually)
FEATURE.CPUPROCANALYZER.DYNAMIC = 1
2. Open ‘/opt/processes.list’ file on the device.
File to configure process names to be monitored
8 Comments
user-7442c
If the output path could also be configurable that would be great
Ganesh Sahu
Hi Vivek,
Could you please provide more information on this query.?
user-7442c
Hi Ganesh,
I see that as of now the path where the output files are written is hardcoded as /opt/logs/. But this tool can be used to monitor the health of the system for a longer periods as well, in that case, the default /opt/logs directory could run out of space. This is more true with client devices where the /opt space is small. Providing an optional arg as to where to store the output files would be more flexible.
Also I observed few more issues on attempts to use this.
1) there is no link or attachment for the visualizer. I had to get it from Unknown User (mounika_lingam) offline.
2) there are empty files found in the resultant directory, which prevented from showing anything on the graphical part. I heard from mounika that the empty files may prevent anything from showing in the visualizer.
3) there are duplicate process & thread entries in the drop downs in the visualizer, choosing most of them didn't show anything on the visualizer
4) from the data I collected I didn't see the overall system cpu & memory usage graph, I only saw process wise graphs but that too as I mentioned in the previous comment were duplicates or didn't show anything on the graph
Ganesh Sahu
Created RDKCOM-2098 to track the request
Unknown User (aamalric)
Hi, Is it possible to get the visualizer ?
Ganesh Sahu
Created RDKCOM-2098 to track the request.
Z-Vineeth Shankar
Is the visualizer support available?
I do not have access to RDKCOM-2098 ticket.
Ganesh Sahu
Hi Unknown User (vineeth_shankar) currently visualizer support is not available