From: Arnaldo Melo <arnaldo.melo@gmail.com>
To: Jiri Olsa <jolsa@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Clark Williams <williams@redhat.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Song Liu <songliubraving@fb.com>
Subject: Re: [PATCH 5/8] perf evlist: Allow reusing the side band thread for more purposes
Date: Fri, 01 May 2020 08:31:16 -0300 [thread overview]
Message-ID: <C4CDADE1-82F4-4033-A9C7-F411C2D7DC28@gmail.com> (raw)
In-Reply-To: <20200501112552.GC1789042@krava>
On May 1, 2020 8:25:52 AM GMT-03:00, Jiri Olsa <jolsa@redhat.com> wrote:
>On Wed, Apr 29, 2020 at 10:11:03AM -0300, Arnaldo Carvalho de Melo
>wrote:
>> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>>
>> I.e. so far we had just one event in that side band thread, a dummy
>one
>> with attr.bpf_event set, so that 'perf record' can go ahead and ask
>the
>> kernel for further information about BPF programs being loaded.
>>
>> Allow for more than one event to be there, so that we can use it as
>> well for the upcoming --switch-output-event feature.
>>
>> Cc: Adrian Hunter <adrian.hunter@intel.com>
>> Cc: Jiri Olsa <jolsa@kernel.org>
>> Cc: Namhyung Kim <namhyung@kernel.org>
>> Cc: Song Liu <songliubraving@fb.com>
>> Link:
>http://lore.kernel.org/lkml/20200427211935.25789-7-acme@kernel.org
>> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>> ---
>> tools/perf/util/evlist.c | 22 ++++++++++++++++++++++
>> tools/perf/util/evlist.h | 1 +
>> 2 files changed, 23 insertions(+)
>>
>> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
>> index 1d0d36da223b..849058766757 100644
>> --- a/tools/perf/util/evlist.c
>> +++ b/tools/perf/util/evlist.c
>> @@ -1777,6 +1777,19 @@ static void *perf_evlist__poll_thread(void
>*arg)
>> return NULL;
>> }
>>
>> +void evlist__set_cb(struct evlist *evlist, perf_evsel__sb_cb_t cb,
>void *data)
>> +{
>> + struct evsel *evsel;
>> +
>> + evlist__for_each_entry(evlist, evsel) {
>> + evsel->core.attr.sample_id_all = 1;
>> + evsel->core.attr.watermark = 1;
>> + evsel->core.attr.wakeup_watermark = 1;
>> + evsel->side_band.cb = cb;
>> + evsel->side_band.data = data;
>> + }
>> +}
>> +
>> int perf_evlist__start_sb_thread(struct evlist *evlist,
>> struct target *target)
>> {
>> @@ -1788,6 +1801,15 @@ int perf_evlist__start_sb_thread(struct evlist
>*evlist,
>> if (perf_evlist__create_maps(evlist, target))
>> goto out_delete_evlist;
>>
>> + if (evlist->core.nr_entries > 1) {
>> + bool can_sample_identifier = perf_can_sample_identifier();
>
>I just found this breaks python, because perf_can_sample_identifier
>is defined in util/record.c
Yeah, I noticed it too, will fix
>
> 19: 'import perf' in python :
> --- start ---
> test child forked, pid 1808205
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ImportError: python/perf.so: undefined symbol:
>perf_can_sample_identifier
> test child finished with -1
> ---- end ----
> 'import perf' in python: FAILED!
>
>jirka
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
next prev parent reply other threads:[~2020-05-01 11:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-29 13:10 [RFC PATCHSET v2] Implement --switch-output-event Arnaldo Carvalho de Melo
2020-04-29 13:10 ` [PATCH 1/8] perf record: Move sb_evlist to 'struct record' Arnaldo Carvalho de Melo
2020-04-29 13:11 ` [PATCH 2/8] perf top: Move sb_evlist to 'struct perf_top' Arnaldo Carvalho de Melo
2020-04-29 13:11 ` [PATCH 3/8] perf bpf: Decouple creating the evlist from adding the SB event Arnaldo Carvalho de Melo
2020-04-30 9:04 ` Jiri Olsa
2020-04-30 13:39 ` Arnaldo Carvalho de Melo
2020-04-29 13:11 ` [PATCH 4/8] perf parse-events: Add parse_events_option() variant that creates evlist Arnaldo Carvalho de Melo
2020-04-29 13:11 ` [PATCH 5/8] perf evlist: Allow reusing the side band thread for more purposes Arnaldo Carvalho de Melo
2020-05-01 11:25 ` Jiri Olsa
2020-05-01 11:31 ` Arnaldo Melo [this message]
2020-04-29 13:11 ` [PATCH 6/8] libsubcmd: Introduce OPT_CALLBACK_SET() Arnaldo Carvalho de Melo
2020-04-29 13:11 ` [PATCH 7/8] perf record: Introduce --switch-output-event Arnaldo Carvalho de Melo
2020-04-29 17:25 ` Ian Rogers
2020-05-11 15:04 ` Arnaldo Carvalho de Melo
2020-04-29 13:11 ` [PATCH 8/8] perf record: Move side band evlist setup to separate routine Arnaldo Carvalho de Melo
2020-04-30 9:05 ` [RFC PATCHSET v2] Implement --switch-output-event Jiri Olsa
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=C4CDADE1-82F4-4033-A9C7-F411C2D7DC28@gmail.com \
--to=arnaldo.melo@gmail.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=jolsa@kernel.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=songliubraving@fb.com \
--cc=tglx@linutronix.de \
--cc=williams@redhat.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).