MCPcopy Create free account
hub / github.com/F-Stack/f-stack / get_app_name

Function get_app_name

dpdk/usertools/dpdk-telemetry.py:41–52  ·  view source on GitHub ↗

return the app name for a given PID, for printing

(pid)

Source from the content-addressed store, hash-verified

39
40
41def get_app_name(pid):
42 """ return the app name for a given PID, for printing """
43 proc_cmdline = os.path.join('/proc', str(pid), 'cmdline')
44 try:
45 with open(proc_cmdline) as f:
46 argv0 = f.read(1024).split('\0')[0]
47 return os.path.basename(argv0)
48 except IOError as e:
49 # ignore file not found errors
50 if e.errno != errno.ENOENT:
51 raise
52 return None
53
54
55def find_sockets(path):

Callers 1

handle_socketFunction · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected