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: <1298027641.5226.666.camel@laptop>
Date:	Fri, 18 Feb 2011 12:14:01 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	David Ahern <daahern@...co.com>
Cc:	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	mingo@...e.hu, acme@...stprotocols.net, paulus@...ba.org
Subject: Re: [PATCH 2/3] perf events: Introduce realtime clock event

On Thu, 2011-02-17 at 22:53 -0700, David Ahern wrote:
> The motivation for this event is to convert perf_clock() time stamps
> to wall-clock (gettimeofday()) equivalents, including adjustments made
> by NTP (e.g., for comparing perf events to other log files).

> This patch is based on the monotonic patch by Arnaldo Carvalho de Melo
> <acme@...hat.com>.
> 
> (NOTE: Comments from the last review of the timehist patch series
> suggested calling this a monotonic clock. I am not trying to be
> dense here; since gettimeofday maps to realtime clock I think that
> is the better name for it.)

Well, the idea was to use CLOCK_MONOTONIC, not to call CLOCK_REALTIME
monotonic.

I'm really not sure why you want CLOCK_REALTIME and I think
CLOCK_MONOTONIC is more useful (I'd argue you want your system logs to
contain both, every admin who's ever had to untangle what happened
during DST switches will agree)

> @@ -5610,6 +5612,13 @@ static enum hrtimer_restart perf_swevent_hrtimer(struct hrtimer *hrtimer)
>  
>  	perf_sample_data_init(&data, 0);
>  	data.period = event->hw.last_period;
> +	if (event->attr.sample_type & PERF_SAMPLE_RAW) 
> +	{
> +		raw.size = sizeof(u64);
> +		raw.data = &event->count;
> +		data.raw = &raw;
> +	}
> +
>  	regs = get_irq_regs();
>  
>  	if (regs && !perf_exclude_event(event, regs)) {


Why!? you already keep ->count = ktime_get_real(), so simply reading the
count value will get you the timestamp.. this is superfluous at best.


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