user2706978
user2706978

Reputation: 141

Unable to use --exclude-perf option in perf command

I'm trying to benchmark my application using perf. The application is c++ based and I want to evaluate

L1-dcache-loads,L1-dcache-load-misses,L1-dcache-stores,cycles,instructions,cache-references,cache-misses,bus-cycles,branch-misses

I want to avoid seeing perf events in my output to make it more easily readable. Trying to run following command to capture the output:

perf record -g -e "L1-dcache-loads,L1-dcache-load-misses,L1-dcache-stores,cycles,instructions,cache-references,cache-misses,bus-cycles,branch-misses" --exclude-perf Binary-name

but above mentioned command is failing with following error:

--exclude-perf option should follow a -e tracepoint option

 Usage: perf record [options] [command]

 or: perf record [options] -- command [options]

 --exclude-perf    don't record events from perf itself

If I don't use --exclude-perf option then my command runs just fine without any error.

Let me know what mistake I'm making while adding the option --exclude-perf

Upvotes: 1

Views: 1525

Answers (1)

osgx
osgx

Reputation: 94225

--exclude-perf is not for sampling/profiling events like you used (Hardware CPU counters). Is it only for tracepoint events: http://lxr.free-electrons.com/source/tools/perf/Documentation/perf-record.txt

151 --exclude-perf::
152         Don't record events issued by perf itself. This option should follow
153         a event selector (-e) which selects tracepoint event(s). It adds a
154         filter expression 'common_pid != $PERFPID' to filters. If other
155         '--filter' exists, the new filter expression will be combined with
156         them by '&&'.

It uses filters and filters are to be attached to tracepoint events.

Upvotes: 2

Related Questions