# SPDX-License-Identifier: GPL-2.0 from __future__ import print_function data = {} times = [] threads = [] cpus = [] def get_key(time, event, cpu, thread): return "%d-%s-%d-%d" % (time, event, cpu, thread) def store_key(time, cpu, thread): if (time not in times): times.append(time) if (cpu not in cpus): cpus.append(cpu) if (thread not in threads): threads.append(thread) def store(time, event, cpu, thread, val, ena, run): #print("event %s cpu %d, thread %d, time %d, val %d, ena %d, run %d" % # (event, cpu, thread, time, val, ena, run)) store_key(time, cpu, thread) key = get_key(time, event, cpu, thread) data[key] = [ val, ena, run] def get(time, event, cpu, thread): key = get_key(time, event, cpu, thread) return data[key][0] def stat__cycles_k(cpu, thread, time, val, ena, run): store(time, "cycles", cpu, thread, val, ena, run); def stat__instructions_k(cpu, thread, time, val, ena, run): store(time, "instructions", cpu, thread, val, ena, run); def stat__cycles_u(cpu, thread, time, val, ena, run): store(time, "cycles", cpu, thread, val, ena, run); def stat__instructions_u(cpu, thread, time, val, ena, run): store(time, "instructions", cpu, thread, val, ena, run); def stat__cycles(cpu, thread, time, val, ena, run): store(time, "cycles", cpu, thread, val, ena, run); def stat__instructions(cpu, thread, time, val, ena, run): store(time, "instructions", cpu, thread, val, ena, run); def stat__interval(time): for cpu in cpus: for thread in threads: cyc = get(time, "cycles", cpu, thread) ins = get(time, "instructions", cpu, thread) cpi = 0 if ins != 0: cpi = cyc/float(ins) print("%15f: cpu %d, thread %d -> cpi %f (%d/%d)" % (time/(float(1000000000)), cpu, thread, cpi, cyc, ins)) def trace_end(): pass # XXX trace_end callback could be used as an alternative place # to compute same values as in the script above: # # for time in times: # for cpu in cpus: # for thread in threads: # cyc = get(time, "cycles", cpu, thread) # ins = get(time, "instructions", cpu, thread) # # if ins != 0: # cpi = cyc/float(ins) # # print("time %.9f, cpu %d, thread %d -> cpi %f" % (time/(float(1000000000)), cpu, thread, cpi)) 'linux-2.6.38.y'>linux-2.6.38.y Hosts the 0x221E linux distro kernel.Ubuntu
summaryrefslogtreecommitdiff
path: root/kernel/nscommon.c
AgeCommit message (Expand)Author
2025-11-11ns: rename is_initial_namespace()Christian Brauner
2025-11-11nstree: switch to new structuresChristian Brauner
2025-11-10ns: add asserts for active refcount underflowChristian Brauner
2025-11-10ns: handle setns(pidfd, ...) cleanlyChristian Brauner
2025-11-10ns: don't increment or decrement initial namespacesChristian Brauner
2025-11-10ns: don't skip active reference count initializationChristian Brauner
2025-11-03nstree: add listns()Christian Brauner
2025-11-03nstree: add unified namespace listChristian Brauner
2025-11-03nstree: maintain list of owned namespacesChristian Brauner
2025-11-03nstree: introduce a unified treeChristian Brauner
2025-11-03ns: add active reference countChristian Brauner
2025-11-03ns: add missing authorshipChristian Brauner
2025-09-25ns: drop assertChristian Brauner
2025-09-25ns: move ns type into struct ns_commonChristian Brauner
2025-09-22ns: add ns_debug()Christian Brauner
2025-09-19ns: rename to __ns_refChristian Brauner
2025-09-19ns: add ns_common_free()Christian Brauner
2025-09-19nscommon: simplify initializationChristian Brauner
2025-09-19mnt: simplify ns_common_init() handlingChristian Brauner
2025-09-19nscommon: move to separate fileChristian Brauner