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: <Y+54Nla62F+dutdu@google.com>
Date:   Thu, 16 Feb 2023 10:38:46 -0800
From:   Namhyung Kim <namhyung@...nel.org>
To:     Jiri Olsa <olsajiri@...il.com>
Cc:     Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Ian Rogers <irogers@...gle.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Kan Liang <kan.liang@...ux.intel.com>,
        Song Liu <song@...nel.org>,
        Stephane Eranian <eranian@...gle.com>,
        Ravi Bangoria <ravi.bangoria@....com>,
        Leo Yan <leo.yan@...aro.org>,
        James Clark <james.clark@....com>, Hao Luo <haoluo@...gle.com>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-perf-users@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH 4/7] perf record: Record dropped sample count

Hi Jiri and Arnaldo,

On Thu, Feb 16, 2023 at 05:34:33PM +0100, Jiri Olsa wrote:
> On Thu, Feb 16, 2023 at 01:32:14PM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Thu, Feb 16, 2023 at 05:23:05PM +0100, Jiri Olsa escreveu:
> > > On Mon, Feb 13, 2023 at 09:04:49PM -0800, Namhyung Kim wrote:
> > > 
> > > SNIP
> > > 
> > > > @@ -1929,12 +1923,27 @@ static void record__read_lost_samples(struct record *rec)
> > > >  
> > > >  		for (int x = 0; x < xyarray__max_x(xy); x++) {
> > > >  			for (int y = 0; y < xyarray__max_y(xy); y++) {
> > > > -				__record__read_lost_samples(rec, evsel, lost, x, y);
> > > > +				struct perf_counts_values count;
> > > > +
> > > > +				if (perf_evsel__read(&evsel->core, x, y, &count) < 0) {
> > > > +					pr_err("read LOST count failed\n");
> > > > +					goto out;
> > > > +				}
> > > > +
> > > > +				if (count.lost) {
> > > > +					__record__save_lost_samples(rec, evsel, lost,
> > > > +								    x, y, count.lost, 0);
> > > > +				}
> > > >  			}
> > > >  		}
> > > > +
> > > > +		lost_count = perf_bpf_filter__lost_count(evsel);
> > > > +		if (lost_count)
> > > > +			__record__save_lost_samples(rec, evsel, lost, 0, 0, lost_count,
> > > > +						    PERF_RECORD_MISC_LOST_SAMPLES_BPF);
> > > 
> > > hi,
> > > I can't see PERF_RECORD_MISC_LOST_SAMPLES_BPF in the tip/perf/core so can't compile,
> > > what do I miss?
> > 
> > Humm, but you shouldn't need kernel headers to build tools/perf/, right?
> 
> right, should be also in tools/include headers

Yeah, sorry about that.  I'm not sure how I missed the part.

I put it in tools/lib/perf/include/perf/event.h only as it does nothing
with kernel.  Will fix in v2.

Thanks,
Namhyung

---8<---

diff --git a/tools/lib/perf/include/perf/event.h b/tools/lib/perf/include/perf/event.h
index ad47d7b31046..51b9338f4c11 100644
--- a/tools/lib/perf/include/perf/event.h
+++ b/tools/lib/perf/include/perf/event.h
@@ -70,6 +70,8 @@ struct perf_record_lost {
        __u64                    lost;
 };

+#define PERF_RECORD_MISC_LOST_SAMPLES_BPF (1 << 15)
+
 struct perf_record_lost_samples {
        struct perf_event_header header;
        __u64                    lost;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ