# system call counts, by pid # (c) 2010, Tom Zanussi # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import syscall_name usage = "perf script -s syscall-counts-by-pid.py [comm]\n"; for_comm = None for_pid = None if len(sys.argv) > 2: sys.exit(usage) if len(sys.argv) > 1: try: for_pid = int(sys.argv[1]) except: for_comm = sys.argv[1] syscalls = autodict() def trace_begin(): print "Press control+C to stop and show the summary" def trace_end(): print_syscall_totals() def raw_syscalls__sys_enter(event_name, context, common_cpu, common_secs, common_nsecs, common_pid, common_comm, id, args): if (for_comm and common_comm != for_comm) or \ (for_pid and common_pid != for_pid ): return try: syscalls[common_comm][common_pid][id] += 1 except TypeError: syscalls[common_comm][common_pid][id] = 1 def print_syscall_totals(): if for_comm is not None: print "\nsyscall events for %s:\n\n" % (for_comm), else: print "\nsyscall events by comm/pid:\n\n", print "%-40s %10s\n" % ("comm [pid]/syscalls", "count"), print "%-40s %10s\n" % ("----------------------------------------", \ "----------"), comm_keys = syscalls.keys() for comm in comm_keys: pid_keys = syscalls[comm].keys() for pid in pid_keys: print "\n%s [%d]\n" % (comm, pid), id_keys = syscalls[comm][pid].keys() for id, val in sorted(syscalls[comm][pid].iteritems(), \ key = lambda(k, v): (v, k), reverse = True): print " %-38s %10d\n" % (syscall_name(id), val), tion> Hosts the 0x221E linux distro kernel.Ubuntu
summaryrefslogtreecommitdiff
path: root/kernel/debug
AgeCommit message (Expand)Author
2026-02-21treewide: Replace kmalloc with kmalloc_obj for non-scalar typesKees Cook
2026-02-17Merge tag 'spdx-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gre...Linus Torvalds
2026-01-27kernel: debug: Add SPDX license ids to kdb filesTim Bird
2026-01-20kernel.h: drop hex.h and update all hex.h usersRandy Dunlap
2025-10-24kdb: Adapt kdb_msg_write to work with NBCON consolesMarcos Paulo de Souza
2025-09-20kdb: remove redundant check for scancode 0xe0Colin Ian King
2025-09-20kdb: Replace deprecated strcpy() with helper function in kdb_defcmd()Thorsten Blum
2025-09-20kdb: Replace deprecated strcpy() with memcpy() in parse_grep()Thorsten Blum
2025-09-20kdb: Replace deprecated strcpy() with memmove() in vkdb_printf()Thorsten Blum
2025-09-20kdb: Replace deprecated strcpy() with memcpy() in kdb_strdup()Thorsten Blum
2025-09-20kernel: debug: gdbstub: Replace deprecated strcpy() with strscpy()Thorsten Blum
2025-04-02Merge tag 'tty-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gre...Linus Torvalds
2025-03-28kdb: Remove optional size arguments from strscpy() callsThorsten Blum
2025-03-28kdb: remove usage of static environment bufferNir Lichtman
2025-02-14Revert "kernel/debug: Mask KGDB NMI upon entry"Douglas Anderson
2025-02-14Revert "kdb: Implement disable_nmi command"Douglas Anderson
2025-01-25kdb: Remove unused flags stackDr. David Alan Gilbert
2025-01-25kdb: use kmap_local_page()Zhang Heng
2024-11-18kdb: fix ctrl+e/a/f/b/d/p/n broken in keyboard modeNir Lichtman
2024-11-02kdb: Fix breakpoint enable to be silent if already enabledNir Lichtman
2024-11-02kdb: Remove fallback interpretation of arbitrary numbers as hexNir Lichtman
2024-11-02kdb: Replace the use of simple_strto with safer kstrto in kdb_mainYuran Pereira
2024-10-02move asm/unaligned.h to linux/unaligned.hAl Viro
2024-06-21kdb: Get rid of redundant kdb_curr_task()Zheng Zengkai
2024-06-21kdb: Use the passed prompt in kdb_position_cursor()Douglas Anderson
2024-06-21kdb: address -Wformat-security warningsArnd Bergmann
2024-04-26kdb: Simplify management of tmpbuffer in kdb_read()Daniel Thompson
2024-04-26kdb: Replace double memcpy() with memmove() in kdb_read()Daniel Thompson
2024-04-26kdb: Use format-specifiers rather than memset() for padding in kdb_read()Daniel Thompson
2024-04-26kdb: Merge identical case statements in kdb_read()Daniel Thompson
2024-04-26kdb: Fix console handling when editing and tab-completing commandsDaniel Thompson
2024-04-26kdb: Use format-strings rather than '\0' injection in kdb_read()Daniel Thompson
2024-04-26kdb: Fix buffer overflow during tab-completeDaniel Thompson
2024-04-22kdb: Use str_plural() to fix Coccinelle warningThorsten Blum
2024-01-17kdb: Fix a potential buffer overflow in kdb_local()Christophe JAILLET