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:	Mon, 30 Mar 2015 11:33:42 -0600
From:	David Ahern <dsahern@...il.com>
To:	Peter Zijlstra <peterz@...radead.org>,
	Stephane Eranian <eranian@...gle.com>
CC:	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Jiri Olsa <jolsa@...hat.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	John Stultz <john.stultz@...aro.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH] perf, record: Add clockid parameter

On 3/28/15 1:55 AM, Peter Zijlstra wrote:
> @@ -761,6 +762,11 @@ void perf_evsel__config(struct perf_evse
>   		attr->disabled = 0;
>   		attr->enable_on_exec = 0;
>   	}
> +
> +	if (opts->clockid >= 0) {
> +		attr->use_clockid = 1;
> +		attr->clockid = opts->clockid;
> +	}
>   }

One more: you need to set attr->clockid to -1 if use_clockid is not set 
so that the analysis side knows whether attr->clockid was used. 
Otherwise it defaults to 0 == CLOCK_REALTIME which is misleading.


diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 1abf6919b8a2..27679ab38511 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -766,7 +766,8 @@ void perf_evsel__config(struct perf_evsel *evsel, 
struct record_opts *opts)
     if (opts->clockid >= 0) {
         attr->use_clockid = 1;
         attr->clockid = opts->clockid;
-   }
+   } else
+       attr->clockid = -1;
  }


Dumping the setting in the header is useful as well:

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index fb432153e2aa..40bc8d010fcb 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1098,6 +1098,7 @@ static void print_event_desc(struct perf_header 
*ph, int fd, FILE *fp)
             }
             fprintf(fp, " }");
         }
+       fprintf(fp, ", clockid = %d", evsel->attr.clockid);

         fputc('\n', fp);
     }
--
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