Hi - I overhauled Akaros perf_events, making it PERFILE2 ABI compliant, making it much more usable (very similar to Linux), and fixing a bunch of major bugs.
The major changes: - You no longer need to hack up and build your own Linux perf, which was error prone. - You can use most any version of Linux perf, instead of trying to find the right version. - You can use Linux-like syntax for `perf record`, so our perf is familiar to those who use Linux's perf - We support generic, pre-defined events. - We support `perf stat` - It won't break as easily. =) - You'll get to do a full rebuild of the toolchain! Let me know if you find any bugs or anything wrong with it and I'll fix it up. Check out Documentation/profiling.txt for an explanation of how to use it. If it doesn't "just work" after following the instructions, then that's a bug on my part. Barret ------------------------------------- The following changes since commit e518d512457c488b98fc25f55fab09249c5f2813: vmm: Only map as much data as you read in. (2016-06-08 22:29:44 -0400) are available in the git repository at: [email protected]:brho/akaros.git perf for you to fetch changes up to 5c7cf60aec59e3348952f693430689687db5cfbc: perf: Update documentation (2016-06-16 18:42:23 -0400) ---------------------------------------------------------------- View this online at: https://github.com/brho/akaros/compare/e518d512457c...5c7cf60aec59 ---------------------------------------------------------------- Barret Rhoden (70): perf: Fix perf's argv[] usage perf: Use tools/Makefrag for building perf perf: Fix memory leak in the profiler perf: Set sample_period perf: Treat the kernel like [kernel.kallsyms] perf: Remove the perf_patch Remove snc Remove kernel path and hostname from #version Remove the BUILD_INFO_FILE variable perf: Use libpfm4 and Linux style event strings perf: Use tracked event info for output perf: Fix fixed counter busy detection perf: Fix GPF when writing fixed trigger counters perf: Fix event enabling logic perf: Enable and disable counters in one step perf: Track the perf_context when converting perf: Use a user_data blob for perf_event (XCC) perf: Clean up attr production perf: Build with warnings and -Werror perf: Fix the perf.data file output perf: Remove the xmem_arena allocator Remove the \n from #version variables Fix #version's stat perf: Add infrastructure for creating headers perf: Emit COMM records for existing processes x86: Fix relocation error in vcore_asm.S Use gnu-user command line options for gcc (XCC) Have gcc link all binaries with --build-id (XCC) Export AKAROS_{SYSROOT,PREFIX} from tools/Makefrag Add elfutils to the distribution perf: Add Linux perf's symbol-elf.c perf: Remove unused parts of symbol-elf.c perf: Port symbol-elf.c Add a build-id to the kernel perf: Emit build-ids for processes and the kernel perf: Handle generic event types perf: Save and emit the command line perf: Remove a few unused bits Fix smp_idle() stack resetting bug Add a sleep utility program Allow kfunc to take decimals and print the retval perf: Fix stream corruption issues perf: Fix racy access to cpu_buf->block perf: Use Linux-style parsing of the core list perf: Rewrite the front end interface Fix sys_proc_create()'s error handling Add helpers to create child processes perf: Remove the built-in 'sleep' command Add timespec helpers (XCC) perf: Clean up perf_{session,alloc} management perf: Remove the kref from perfmon_session perf: Report errors when counter setup fails perf: Fix race in arch_perf_write() perf: Shutdown profiler/sampling on kpctl close perf: Minimize the sampling of perf itself perf: Add the perf stat subcommand perf: Use stat instead of seeks for xfsize perf: Delay the opening of kpctl perf: Remove the kprof.pdata staging ground perf: Output Version 0 perf_event_attrs perf: Don't output counters for perf record perf: Remove unused CMD_COUNTER_STATUS bits (XCC) perf: Use PERF_SAMPLE_IDENTIFIER Handle lack of chaninfo() in print_chaninfo() Remove op2.go Remove kprof's timer (XCC) perf: Track PIDs for kernel samples (XCC) perf: Report maximum values for counter overflow perf: Move to dev-utils/perf perf: Update documentation Documentation/profiling.txt | 351 +++++---- Makefile | 8 +- kern/arch/riscv/Makefile | 4 - kern/arch/riscv/kernel.ld | 1 + kern/arch/x86/Makefile | 4 - kern/arch/x86/devarch.c | 46 +- kern/arch/x86/kernel64.ld | 1 + kern/arch/x86/perfmon.c | 402 ++++++---- kern/arch/x86/perfmon.h | 7 +- kern/arch/x86/ros/perfmon.h | 5 +- kern/build_id.ld | 9 + kern/drivers/dev/kprof.c | 200 ++--- kern/drivers/dev/version.c | 74 +- kern/include/build_info.h | 2 - kern/include/profiler.h | 3 +- kern/include/ros/profiler_records.h | 13 +- kern/src/Kbuild | 28 +- kern/src/monitor.c | 84 ++- kern/src/ns/qio.c | 3 +- kern/src/ns/sysfile.c | 10 +- kern/src/profiler.c | 104 ++- kern/src/smp.c | 12 +- kern/src/syscall.c | 46 +- scripts/perf | 18 + tests/sleep.c | 18 + tests/strace.c | 9 +- tools/Makefrag | 8 +- tools/apps/snc/.gitignore | 1 - tools/apps/snc/Makefile | 2 - tools/apps/snc/snc.c | 105 --- tools/compilers/gcc-glibc/Makefile | 4 + .../gcc-glibc/gcc-4.9.2-akaros/gcc/config.gcc | 2 + .../glibc-2.19-akaros/sysdeps/akaros/Versions | 2 + .../glibc-2.19-akaros/sysdeps/akaros/time.c | 28 + .../glibc-2.19-akaros/sysdeps/akaros/time.h | 8 +- .../glibc-2.19-akaros/sysdeps/akaros/time/time.h | 8 +- .../glibc-2.19-akaros/sysdeps/akaros/timerfd.c | 29 +- tools/dev-libs/elfutils/.gitignore | 1 + tools/dev-libs/elfutils/Makefile | 66 ++ .../akaros-patches/0.164/001_config_sub.patch | 32 + .../akaros-patches/0.164/002_user_regs.patch | 12 + tools/{profile => dev-util}/perf/.gitignore | 0 tools/dev-util/perf/Makefile | 36 + tools/{profile => dev-util}/perf/akaros.c | 104 +-- tools/{profile => dev-util}/perf/akaros.h | 0 tools/dev-util/perf/elf.h | 8 + tools/dev-util/perf/perf.c | 620 +++++++++++++++ tools/dev-util/perf/perf_core.c | 779 +++++++++++++++++++ tools/{profile => dev-util}/perf/perf_core.h | 35 +- tools/{profile => dev-util}/perf/perf_format.h | 62 +- tools/dev-util/perf/perfconv.c | 833 +++++++++++++++++++++ tools/{profile => dev-util}/perf/perfconv.h | 19 +- tools/dev-util/perf/symbol-elf.c | 301 ++++++++ tools/{profile => dev-util}/perf/xlib.c | 132 ++-- tools/{profile => dev-util}/perf/xlib.h | 17 +- tools/profile/op2.go | 107 --- tools/profile/perf/Makefile | 42 -- tools/profile/perf/perf.c | 198 ----- tools/profile/perf/perf_core.c | 696 ----------------- tools/profile/perf/perf_patches/perf_patch.diff | 201 ----- tools/profile/perf/perfconv.c | 599 --------------- user/parlib/include/parlib/parlib.h | 7 +- user/parlib/parlib.c | 80 ++ user/parlib/x86/vcore_asm.S | 4 +- 64 files changed, 3856 insertions(+), 2794 deletions(-) create mode 100644 kern/build_id.ld create mode 100755 scripts/perf create mode 100644 tests/sleep.c delete mode 100644 tools/apps/snc/.gitignore delete mode 100644 tools/apps/snc/Makefile delete mode 100644 tools/apps/snc/snc.c create mode 100644 tools/dev-libs/elfutils/.gitignore create mode 100644 tools/dev-libs/elfutils/Makefile create mode 100644 tools/dev-libs/elfutils/akaros-patches/0.164/001_config_sub.patch create mode 100644 tools/dev-libs/elfutils/akaros-patches/0.164/002_user_regs.patch rename tools/{profile => dev-util}/perf/.gitignore (100%) create mode 100644 tools/dev-util/perf/Makefile rename tools/{profile => dev-util}/perf/akaros.c (58%) rename tools/{profile => dev-util}/perf/akaros.h (100%) create mode 100644 tools/dev-util/perf/elf.h create mode 100644 tools/dev-util/perf/perf.c create mode 100644 tools/dev-util/perf/perf_core.c rename tools/{profile => dev-util}/perf/perf_core.h (69%) rename tools/{profile => dev-util}/perf/perf_format.h (89%) create mode 100644 tools/dev-util/perf/perfconv.c rename tools/{profile => dev-util}/perf/perfconv.h (79%) create mode 100644 tools/dev-util/perf/symbol-elf.c rename tools/{profile => dev-util}/perf/xlib.c (64%) rename tools/{profile => dev-util}/perf/xlib.h (80%) delete mode 100644 tools/profile/op2.go delete mode 100644 tools/profile/perf/Makefile delete mode 100644 tools/profile/perf/perf.c delete mode 100644 tools/profile/perf/perf_core.c delete mode 100644 tools/profile/perf/perf_patches/perf_patch.diff delete mode 100644 tools/profile/perf/perfconv.c -- You received this message because you are subscribed to the Google Groups "Akaros" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
