lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 01 May 2020 08:31:16 -0300
From:   Arnaldo Melo <arnaldo.melo@...il.com>
To:     Jiri Olsa <jolsa@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>
CC:     Jiri Olsa <jolsa@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Clark Williams <williams@...hat.com>,
        linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Song Liu <songliubraving@...com>
Subject: Re: [PATCH 5/8] perf evlist: Allow reusing the side band thread for more purposes



On May 1, 2020 8:25:52 AM GMT-03:00, Jiri Olsa <jolsa@...hat.com> wrote:
>On Wed, Apr 29, 2020 at 10:11:03AM -0300, Arnaldo Carvalho de Melo
>wrote:
>> From: Arnaldo Carvalho de Melo <acme@...hat.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@...el.com>
>> Cc: Jiri Olsa <jolsa@...nel.org>
>> Cc: Namhyung Kim <namhyung@...nel.org>
>> Cc: Song Liu <songliubraving@...com>
>> Link:
>http://lore.kernel.org/lkml/20200427211935.25789-7-acme@kernel.org
>> Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ