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]
Message-ID: <55E68BCF.4070609@huawei.com>
Date:	Wed, 2 Sep 2015 13:40:31 +0800
From:	"Wangnan (F)" <wangnan0@...wei.com>
To:	Namhyung Kim <namhyung@...nel.org>
CC:	<acme@...hat.com>, <mingo@...nel.org>, <ast@...mgrid.com>,
	<linux-kernel@...r.kernel.org>, <lizefan@...wei.com>,
	<pi3orama@....com>, Brendan Gregg <brendan.d.gregg@...il.com>,
	Daniel Borkmann <daniel@...earbox.net>,
	David Ahern <dsahern@...il.com>, He Kuang <hekuang@...wei.com>,
	Jiri Olsa <jolsa@...nel.org>, Kaixu Xia <xiakaixu@...wei.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH 07/31] perf probe: Attach trace_probe_event with perf_probe_event



On 2015/9/2 12:32, Namhyung Kim wrote:
> Hi,
>
> On Sat, Aug 29, 2015 at 04:21:41AM +0000, Wang Nan wrote:
>> This patch drops struct __event_package structure. Instead, it adds
>> trace_probe_event into 'struct perf_probe_event'.
>>
>> trace_probe_event information gives further patches a chance to access
>> actual probe points and actual arguments. Using them, bpf_loader will
>> be able to attach one bpf program to different probing points of a
>> inline functions (which has multiple probing points) and glob
>> functions. Moreover, by reading arguments information, bpf code for
>> reading those arguments can be generated.
>>
>> Signed-off-by: Wang Nan <wangnan0@...wei.com>
>> Cc: Alexei Starovoitov <ast@...mgrid.com>
>> Cc: Brendan Gregg <brendan.d.gregg@...il.com>
>> Cc: Daniel Borkmann <daniel@...earbox.net>
>> Cc: David Ahern <dsahern@...il.com>
>> Cc: He Kuang <hekuang@...wei.com>
>> Cc: Jiri Olsa <jolsa@...nel.org>
>> Cc: Kaixu Xia <xiakaixu@...wei.com>
>> Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
>> Cc: Namhyung Kim <namhyung@...nel.org>
>> Cc: Paul Mackerras <paulus@...ba.org>
>> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
>> Cc: Zefan Li <lizefan@...wei.com>
>> Cc: pi3orama@....com
>> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
>> Link: http://lkml.kernel.org/n/1436445342-1402-22-git-send-email-wangnan0@huawei.com
>> ---
> [SNIP]
>
>> +int add_perf_probe_events(struct perf_probe_event *pevs, int npevs,
>> +			  bool cleanup)
>> +{
>> +	int i, ret;
>>   
>>   	ret = init_symbol_maps(pevs->uprobes);
>> -	if (ret < 0) {
>> -		free(pkgs);
>> +	if (ret < 0)
>>   		return ret;
>> -	}
>>   
>>   	/* Loop 1: convert all events */
>>   	for (i = 0; i < npevs; i++) {
>> -		pkgs[i].pev = &pevs[i];
>>   		/* Init kprobe blacklist if needed */
>> -		if (!pkgs[i].pev->uprobes)
>> +		if (pevs[i].uprobes)
> Missing '!'.

It's my fault. Already fixed in my local tree.

Thank you for your review!

> Thanks,
> Namhyung
>
>
>>   			kprobe_blacklist__init();
>>   		/* Convert with or without debuginfo */
>> -		ret  = convert_to_probe_trace_events(pkgs[i].pev,
>> -						     &pkgs[i].tevs);
>> -		if (ret < 0)
>> +		ret  = convert_to_probe_trace_events(&pevs[i], &pevs[i].tevs);
>> +		if (ret < 0) {
>> +			cleanup = true;
>>   			goto end;
>> -		pkgs[i].ntevs = ret;
>> +		}
>> +		pevs[i].ntevs = ret;
>>   	}
>>   	/* This just release blacklist only if allocated */
>>   	kprobe_blacklist__release();
>>   
>>   	/* Loop 2: add all events */
>>   	for (i = 0; i < npevs; i++) {
>> -		ret = __add_probe_trace_events(pkgs[i].pev, pkgs[i].tevs,
>> -					       pkgs[i].ntevs,
>> +		ret = __add_probe_trace_events(&pevs[i], pevs[i].tevs,
>> +					       pevs[i].ntevs,
>>   					       probe_conf.force_add);
>>   		if (ret < 0)
>>   			break;
>>   	}
>>   end:
>>   	/* Loop 3: cleanup and free trace events  */
>> -	for (i = 0; i < npevs; i++) {
>> -		for (j = 0; j < pkgs[i].ntevs; j++)
>> -			clear_probe_trace_event(&pkgs[i].tevs[j]);
>> -		zfree(&pkgs[i].tevs);
>> -	}
>> -	free(pkgs);
>> +	for (i = 0; cleanup && (i < npevs); i++)
>> +		cleanup_perf_probe_event(&pevs[i]);
>>   	exit_symbol_maps();
>>   
>>   	return ret;


--
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