# 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)) -2.6.38.y Hosts the 0x221E linux distro kernel.Ubuntu
summaryrefslogtreecommitdiff
path: root/Kbuild
AgeCommit message (Expand)Author
2019-03-10Merge tag 'kbuild-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masa...Linus Torvalds
2019-02-27kbuild: remove unimportant comments from ./KbuildMasahiro Yamada
2019-02-27scripts/gdb: delay generation of gdb constants.pyMasahiro Yamada
2019-02-11Merge branch 'locking/atomics' into locking/core, to pick up WIP commitsIngo Molnar
2019-01-06kbuild: use assignment instead of define ... endef for filechk_* rulesMasahiro Yamada
2019-01-06kbuild: change filechk to surround the given command with { }Masahiro Yamada
2018-12-25kbuild: remove unused cmd_gentimeconstMasahiro Yamada
2018-12-23kbuild: remove $(obj)/ prefixes in ./KbuildMasahiro Yamada
2018-12-23treewide: remove explicit rules for *offsets.sMasahiro Yamada
2018-11-09locking/atomics: Fix out-of-tree buildBorislav Petkov
2018-11-01locking/atomics: Check generated headers are up-to-dateMark Rutland
2017-11-17Merge tag 'kbuild-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mas...Linus Torvalds
2017-11-16kbuild: remove redundant mkdir from ./KbuildMasahiro Yamada
2017-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman
2017-04-13kbuild: Consolidate header generation from ASM offset informationMatthias Kaehlcke
2016-05-23scripts/gdb: provide linux constantsKieran Bingham