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: <20130910195847.GA1866@ghostprotocols.net>
Date:	Tue, 10 Sep 2013 16:58:47 -0300
From:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	"mingo@...e.hu" <mingo@...e.hu>,
	"ak@...ux.intel.com" <ak@...ux.intel.com>,
	Jiri Olsa <jolsa@...hat.com>,
	Namhyung Kim <namhyung.kim@....com>,
	David Ahern <dsahern@...il.com>
Subject: Re: [PATCH v2 2/2] perf tools: add attr->mmap2 support

Em Tue, Sep 10, 2013 at 10:17:28AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Sep 10, 2013 at 03:05:03PM +0200, Stephane Eranian escreveu:
> > On Tue, Sep 10, 2013 at 3:00 PM, Arnaldo Carvalho de Melo <acme@...stprotocols.net> wrote:
> > > Em Mon, Sep 09, 2013 at 04:48:44PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > +++ b/kernel/events/core.c
> > > @@ -5039,6 +5039,7 @@ static void perf_event_mmap_output(struct perf_event *event,
> > >                 mmap_event->event_id.header.size += sizeof(mmap_event->maj);
> > >                 mmap_event->event_id.header.size += sizeof(mmap_event->min);
> > >                 mmap_event->event_id.header.size += sizeof(mmap_event->ino);
> > > +               mmap_event->event_id.header.size += sizeof(mmap_event->ino_generation);
> > >         }
> > >         perf_event_header__init_id(&mmap_event->event_id.header, &sample, event);

> > Arg, yes, this is missing.
> > Do you want to submit the patch?

> I will, in some jiffies, just rebooting with the patched kernel to
> re-run tperf test.
 
> > Thanks for tracking it down.
 
> np :-)

More fallout, this time the resulting tools fail to run on older
kernels, i.e. any kernel that doesn't have perf_event_attr.mmap2,
doesn't matter the event type:

[acme@zoo linux]$ perf record usleep 1
Error:
The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (cycles).  
/bin/dmesg may provide additional information.
No CONFIG_PERF_EVENTS=y kernel support configured?

usleep: Terminated
[acme@zoo linux]$ perf record -e cpu-clock usleep 1
Error:
The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (cpu-clock).  
/bin/dmesg may provide additional information.
No CONFIG_PERF_EVENTS=y kernel support configured?

usleep: Terminated
[acme@zoo linux]$

That is because kernel/events/core.c  perf_copy_attr() has this test:

        if (attr->__reserved_1)
                return -EINVAL;

So we must have the handling we have for other things that were added
in the past, like .sample_id_all, .exclude_guest, etc, like is done in
the attached patch, please ack.

Ingo, since you haven't merged my latest perf/urgent pull req, do you
want me to fold this into the patch that makes the tooling side use
PERF_RECORD_MMAP2?

- Arnaldo

View attachment "perf_mmap2_fallback.patch" of type "text/plain" (1500 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ