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, 22 Nov 2013 23:33:29 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	linux-kernel@...r.kernel.org,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>, Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	David Ahern <dsahern@...il.com>
Subject: Re: [PATCH 05/22] tools lib traceevent: Add hrtimer plugin

2013-11-21 (목), 12:01 +0100, Jiri Olsa:
> Backporting hrtimer plugin.
> 
> Backported from Steven Rostedt's trace-cmd repo (HEAD 0f2c2fb):
> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
> 
> This plugin adds function field resolving for following
> tracepoint events:
>   timer:hrtimer_expire_entry
>   timer:hrtimer_start
> 
> The diff of 'perf script' output generated by old and new code:
> (data was generated by 'perf record -e 'timer:hrtimer*' -a')
> 
> --- script.hrtimer.old
> +++ script.hrtimer.new
> -         swapper     0 [000] 27405.519092: timer:hrtimer_start: [FAILED TO PARSE] hrtimer=0xffff88021e20e800 function=0xffffffff810c0e10 expires=27398383000000 softexpires=27398383000000
> +         swapper     0 [000] 27405.519103: timer:hrtimer_start: hrtimer=0xffff88021e20e800 function=tick_sched_timer expires=27398383000000 softexpires=27398383000000
> -         swapper     0 [001] 27405.519544: timer:hrtimer_expire_entry: [FAILED TO PARSE] hrtimer=0xffff880211334058 now=27398294182491 function=0xffffffff81086f20
> +         swapper     0 [001] 27405.519544: timer:hrtimer_expire_entry: hrtimer=0xffff880211334058 now=27398294182491 function=posix_timer_fn/0x0
> 
> Check the 'function' field is translated into the function name.

[SNIP]
> +	if (!fn) {
> +		trace_seq_printf(s, " function=MISSING");
> +	} else {
> +		unsigned long long function;
> +		const char *func;
> +
> +		if (pevent_read_number_field(fn, data, &function))
> +			trace_seq_printf(s, " function=INVALID");
> +
> +		func = pevent_find_function(pevent, function);
> +
> +		trace_seq_printf(s, " function=%s", func);

Shouldn't it be like below?

		if (pevent_read_number_field(fn, data, &function))
			trace_seq_printf(s, " function=INVALID");
		else {
			func = pevent_find_function(pevent, function);
			trace_seq_printf(s, " function=%s", func);
		}

Otherwise it'll print "function=XXX" twice if pevent_read_number_field()
failed.

Thanks,
Namhyung


> +	}
> +
> +	trace_seq_printf(s, " expires=");
> +	pevent_print_num_field(s, "%llu", event, "expires", record, 1);
> +
> +	trace_seq_printf(s, " softexpires=");
> +	pevent_print_num_field(s, "%llu", event, "softexpires", record, 1);
> +	return 0;
> +}
> +
> +int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
> +{
> +	pevent_register_event_handler(pevent, -1,
> +				      "timer", "hrtimer_expire_entry",
> +				      timer_expire_handler, NULL);
> +
> +	pevent_register_event_handler(pevent, -1, "timer", "hrtimer_start",
> +				      timer_start_handler, NULL);
> +	return 0;
> +}



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