diff options
author | 2017-01-29 18:07:33 +0200 | |
---|---|---|
committer | 2017-01-29 18:07:33 +0200 | |
commit | 519ea63d05c655a75602eb8cd77c84e6e49e827d (patch) | |
tree | dbfb7325178a86149efce096494535b886907df7 /scripts/trex_show_threads.py | |
parent | 42664b05103d0f4a7ed272301051d58d6e8f3737 (diff) | |
parent | efbe56332fdf6a5c386152e4a2af3a2b56f723b5 (diff) |
Merge branch 'master' into capture
Diffstat (limited to 'scripts/trex_show_threads.py')
-rwxr-xr-x | scripts/trex_show_threads.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/trex_show_threads.py b/scripts/trex_show_threads.py index 1824d073..d0e34fe9 100755 --- a/scripts/trex_show_threads.py +++ b/scripts/trex_show_threads.py @@ -17,7 +17,8 @@ def read_task_stats (task_path): stat_data = open(stat, 'r').readline().split() stats_dict['last_sched_cpu'] = stat_data[-14] - + stats_dict['priority'] = stat_data[17] if stat_data[43] == '0' else 'RT' + return stats_dict @@ -26,7 +27,7 @@ def show_threads (pid): task_paths = ["{0}/{1}".format(process_dir, task) for task in os.listdir(process_dir)] - header = [ 'Task Name', 'PID', 'Allowed CPU', 'Last Sched CPU', 'Asked Ctx Switch', 'Forced Ctx Switch'] + header = [ 'Task Name', 'PID', 'Priority', 'Allowed CPU', 'Last Sched CPU', 'Asked Ctx Switch', 'Forced Ctx Switch'] for x in header: print('{:^20}'.format(x)), print("") @@ -41,6 +42,7 @@ def show_threads (pid): # name print("{:<20}".format(task['name'])), print("{:^20}".format(task['pid'])), + print("{:^20}".format(task['priority'])), print("{:^20}".format(task['cpus_allowed_list'])), print("{:^20}".format(task['last_sched_cpu'])), print("{:^20}".format(task['voluntary_ctxt_switches'])), |