perf
perf copied to clipboard
build examples fails
Hi,
can build the library, but make examples fails with:
/usr/bin/ld: /tmp/ccDOH6Fz.o:/home/matt/dev/smart/perf/examples/full/harness.h:19: multiple definition of `measurements'; /tmp/ccX0hXle.o:/home/matt/dev/smart/perf/examples/full/harness.h:19: first defined here
/usr/bin/ld: /tmp/ccDOH6Fz.o:/home/matt/dev/smart/perf/examples/full/harness.h:22: multiple definition of `all_measurements'; /tmp/ccX0hXle.o:/home/matt/dev/smart/perf/examples/full/harness.h:22: first defined here
/usr/bin/ld: /tmp/ccDOH6Fz.o:/home/matt/dev/smart/perf/examples/full/harness.h:24: multiple definition of `measure_instruction_count'; /tmp/ccX0hXle.o:/home/matt/dev/smart/perf/examples/full/harness.h:24: first defined here
/usr/bin/ld: /tmp/ccDOH6Fz.o:/home/matt/dev/smart/perf/examples/full/harness.h:26: multiple definition of `measure_cycle_count'; /tmp/ccX0hXle.o:/home/matt/dev/smart/perf/examples/full/harness.h:26: first defined here
/usr/bin/ld: /tmp/ccDOH6Fz.o:/home/matt/dev/smart/perf/examples/full/harness.h:28: multiple definition of `measure_context_switches'; /tmp/ccX0hXle.o:/home/matt/dev/smart/perf/examples/full/harness.h:28: first defined here
/usr/bin/ld: /tmp/ccDOH6Fz.o:/home/matt/dev/smart/perf/examples/full/harness.h:31: multiple definition of `measure_cpu_clock'; /tmp/ccX0hXle.o:/home/matt/dev/smart/perf/examples/full/harness.h:31: first defined here
/usr/bin/ld: /tmp/ccDOH6Fz.o:/home/matt/dev/smart/perf/examples/full/harness.h:33: multiple definition of `measure_cpu_branches'; /tmp/ccX0hXle.o:/home/matt/dev/smart/perf/examples/full/harness.h:33: first defined here
same here, @nishihatapalmer were you able to find smth else?
No, I just wrote my own code. The source here was useful, and I also read the Linux documentation. Wasn't too hard in the end.
did you try libpfm?
I've added a Dockerfile that shows how it can be built and run. It "should just work" to run make
and then ./build/examples/full
, for example. Note that there are some privileges required. In the case of the example for running the container, the container will be given full privileges.
Closing. Feel free to reopen if your issues remain unsolved.