From: Wang Nan <wangnan0@huawei.com>
To: <acme@kernel.org>, <ast@plumgrid.com>, <adrian.hunter@intel.com>
Cc: <linux-kernel@vger.kernel.org>, <pi3orama@163.com>,
<lizefan@huawei.com>, Wang Nan <wangnan0@huawei.com>
Subject: [RFC PATCH v2 0/2] perf tools: Don't set inherit bit for system wide evsel
Date: Mon, 26 Oct 2015 11:41:58 +0000 [thread overview]
Message-ID: <1445859720-146146-1-git-send-email-wangnan0@huawei.com> (raw)
Previous version can be found from [1].
To make bpf_perf_event_output() and bpf_perf_event_read() easier to be
used, these two patches set inherit to 0 for system wide evsels.
After applying them, users are possible to pass system wide events to
BPF programs in following command, and don't need to consider the
setting of inherit:
# perf record -a -e evt=cycles -e ./test__map.c/maps.pmu_map.event=evt/ ...
Patch 1/2 set evsel->system_wide for system wide target. I have checked
in current evlist.c and evsel.c. The only behavior change I found is in
evlist.c:
/*
* The system_wide flag causes a selected event to be opened
* always without a pid. Consequently it will never get a
* POLLHUP, but it is used for tracking in combination with
* other events, so it should not need to be polled anyway.
* Therefore don't add it for polling.
*/
if (!evsel->system_wide &&
__perf_evlist__add_pollfd(evlist, fd, idx) < 0) {
perf_evlist__mmap_put(evlist, idx);
return -1;
}
With patch 1/2, __perf_evlist__add_pollfd() won't be called. From the
comment I pasted this modification looks harmless.
[1] http://lkml.kernel.org/r/1445597029-133332-1-git-send-email-wangnan0@huawei.com
Wang Nan (2):
perf tools: Set evsel->system_wide field for global system wide
recording
perf tools: Don't set inherit bit for system wide evsel
tools/perf/util/evsel.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--
1.8.3.4
next reply other threads:[~2015-10-26 11:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 11:41 Wang Nan [this message]
2015-10-26 11:41 ` [RFC PATCH v2 1/2] perf tools: Set evsel->system_wide field for global system wide recording Wang Nan
2015-10-26 12:24 ` Adrian Hunter
2015-10-26 12:39 ` Wangnan (F)
2015-10-26 13:02 ` Adrian Hunter
2015-10-27 3:23 ` Wangnan (F)
2015-10-26 11:42 ` [RFC PATCH v2 2/2] perf tools: Don't set inherit bit for system wide evsel Wang Nan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1445859720-146146-1-git-send-email-wangnan0@huawei.com \
--to=wangnan0@huawei.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ast@plumgrid.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=pi3orama@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).