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:	Thu, 27 Jun 2013 10:58:39 +0300
From:	Adrian Hunter <adrian.hunter@...el.com>
To:	Jiri Olsa <jolsa@...hat.com>
CC:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	linux-kernel@...r.kernel.org, David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Mike Galbraith <efault@....de>,
	Namhyung Kim <namhyung@...il.com>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 02/15] perf tools: fix missing tool parameter

On 25/06/13 16:04, Jiri Olsa wrote:
> On Mon, Jun 24, 2013 at 04:15:59PM +0300, Adrian Hunter wrote:
>> perf inject expects to get a reference to 'struct perf_inject'
>> from its 'tool' member.  For that to work, 'tool' needs to be
>> a parameter of all tool callbacks.  Make it so.
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
>> ---
>>  tools/perf/builtin-inject.c | 24 ++++++++++--------------
>>  tools/perf/util/header.c    |  6 ++++--
>>  tools/perf/util/header.h    |  6 ++++--
>>  tools/perf/util/session.c   | 11 +++++++----
>>  tools/perf/util/tool.h      |  9 ++++-----
>>  5 files changed, 29 insertions(+), 27 deletions(-)
>>
>> diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
>> index f299ddf..fb341f1 100644
>> --- a/tools/perf/builtin-inject.c
>> +++ b/tools/perf/builtin-inject.c
>> @@ -73,22 +73,17 @@ static int perf_event__repipe_event_type_synth(struct perf_tool *tool,
>>  	return perf_event__repipe_synth(tool, event);
>>  }
>>  
>> -static int perf_event__repipe_tracing_data_synth(union perf_event *event,
>> -						 struct perf_session *session
>> -						 __maybe_unused)
>> -{
>> -	return perf_event__repipe_synth(NULL, event);
>> -}
>> -
>> -static int perf_event__repipe_attr(union perf_event *event,
>> -				   struct perf_evlist **pevlist __maybe_unused)
>> +static int perf_event__repipe_attr(struct perf_tool *tool,
>> +				   union perf_event *event,
>> +				   struct perf_evlist **pevlist)
>>  {
>>  	int ret;
>> -	ret = perf_event__process_attr(event, pevlist);
>> +
>> +	ret = perf_event__process_attr(tool, event, pevlist);
>>  	if (ret)
>>  		return ret;
>>  
>> -	return perf_event__repipe_synth(NULL, event);
>> +	return perf_event__repipe_synth(tool, event);
>>  }
>>  
>>  static int perf_event__repipe(struct perf_tool *tool,
>> @@ -147,13 +142,14 @@ static int perf_event__repipe_fork(struct perf_tool *tool,
>>  	return err;
>>  }
>>  
>> -static int perf_event__repipe_tracing_data(union perf_event *event,
>> +static int perf_event__repipe_tracing_data(struct perf_tool *tool,
>> +					   union perf_event *event,
>>  					   struct perf_session *session)
>>  {
>>  	int err;
>>  
>>  	perf_event__repipe_synth(NULL, event);
> 
> wouldn't this one cause segfault?

Thanks for reviewing.  Fixed in V2.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ