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: <20190312035224.30350-2-andi@firstfloor.org>
Date:   Mon, 11 Mar 2019 20:52:22 -0700
From:   Andi Kleen <andi@...stfloor.org>
To:     acme@...nel.org
Cc:     jolsa@...nel.org, linux-perf-users@...r.kernel.org,
        linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>
Subject: [PATCH 1/3] perf, tools, report: Handle samples without time

From: Andi Kleen <ak@...ux.intel.com>

When a sample doesn't have a time stamp (e.g. from --no-time),
show the beginning of the trace for res samples instead of generating
an impossible time range that errors out.

Signed-off-by: Andi Kleen <ak@...ux.intel.com>
---
 tools/perf/ui/browsers/res_sample.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/ui/browsers/res_sample.c b/tools/perf/ui/browsers/res_sample.c
index c0dd73176d42..c450a3536f10 100644
--- a/tools/perf/ui/browsers/res_sample.c
+++ b/tools/perf/ui/browsers/res_sample.c
@@ -60,7 +60,9 @@ int res_sample_browse(struct res_sample *res_samples, int num_res,
 		return -1;
 	r = &res_samples[choice];
 
-	n = timestamp__scnprintf_nsec(r->time - context_len, trange, sizeof trange);
+	n = timestamp__scnprintf_nsec(r->time > context_len ?
+				      r->time - context_len : r->time,
+				      trange, sizeof trange);
 	trange[n++] = ',';
 	timestamp__scnprintf_nsec(r->time + context_len, trange + n, sizeof trange - n);
 
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ