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, 9 Oct 2017 11:09:44 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Andi Kleen <andi@...stfloor.org>, Jiri Olsa <jolsa@...nel.org>,
        Wang Nan <wangnan0@...wei.com>, linux-kernel@...r.kernel.org,
        Andi Kleen <ak@...ux.intel.com>, He Kuang <hekuang@...wei.com>,
        Alexei Starovoitov <ast@...com>
Subject: Re: [PATCH 2/2] perf, tools: Don't force MetricExprs to lower case

Em Mon, Oct 09, 2017 at 03:41:51PM +0200, Jiri Olsa escreveu:
> On Wed, Oct 04, 2017 at 09:27:11AM -0700, Andi Kleen wrote:
> > On Wed, Oct 04, 2017 at 12:30:52PM +0200, Jiri Olsa wrote:
> > > right, it looks like we allow whole path (including / char)
> > > for BPF file, which messes up with out pmu/.../ syntax

> > > do we need that? (Cc-ed some bpf folks)

> > > if not attached patch seems to fix things.. otherwise
> > > we need to come up with another fix

> > I tried similar patches, but I always ran into more complex
> > situations where it still matched incorrectly.

> > e.g. try it with cpu/uops_executed.core,... vs uops_executed.core

> hm, both works for me with the change:

>   perf stat -e cpu/uops_executed.core/ ls
>   perf stat -e uops_executed.core ls

> > The only real fix would be probably to add some unique 
> > prefix for BPF, but that would break all existing users.

> yea, there was no response from bpf folks, but it's  probably not an option
 
> how about checking if the file exist like below..

Works well for me, Jiri, I found a problem in the last case, can you take a look?

[root@...et bpf]# perf stat -e cpu/uops_executed.core/,uops_executed.core sleep 1

 Performance counter stats for 'sleep 1':

         1,094,963      cpu/uops_executed.core/                                     
         1,094,963      uops_executed.core                                          

       1.001925575 seconds time elapsed

[root@...et bpf]# perf stat -e uops_executed.core sleep 1

 Performance counter stats for 'sleep 1':

         2,309,245      uops_executed.core                                          

       1.003314897 seconds time elapsed

[root@...et bpf]# perf stat -e cpu/uops_executed.core/ sleep 1

 Performance counter stats for 'sleep 1':

         1,664,618      cpu/uops_executed.core/                                     

       1.002284214 seconds time elapsed

[root@...et bpf]# cat sys_read.c 
#define SEC(NAME) __attribute__((section(NAME), used))
SEC("func=sys_read")
int bpf_func__sys_read(void *ctx)
{
	return 1;
}
char _license[] SEC("license") = "GPL";
int _version SEC("version") = LINUX_VERSION_CODE;
[root@...et bpf]# perf trace --no-syscalls -e sys_read.c/max-stack=5/ sleep 1
bpf: builtin compilation failed: -95, try external compiler
     0.000 perf_bpf_probe:func:(ffffffffb7263190))
                                       sys_read ([kernel.kallsyms])
                                       entry_SYSCALL_64_fastpath ([kernel.kallsyms])
                                       __read (/usr/lib64/ld-2.25.so)
                                       _dl_map_object (/usr/lib64/ld-2.25.so)
[root@...et bpf]# perf trace --no-syscalls -e sys_read.c sleep 1
bpf: builtin compilation failed: -95, try external compiler
     0.000 perf_bpf_probe:func:(ffffffffb7263190))
[root@...et bpf]#

[root@...et bpf]# perf stat -e UOPS_EXECUTED.CORE sleep 1

 Performance counter stats for 'sleep 1':

         1,205,347      UOPS_EXECUTED.CORE                                          

       1.001694225 seconds time elapsed

But I noticed this problem:

[root@...et bpf]# perf stat -e cpu/uops_executed.core/,uops_executed.core,cpu/UOPS_EXECUTED.CORE sleep 1
event syntax error: '..d=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=01;05;37;41:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:IY�'
                                  \___ parser error
Run 'perf list' for a list of valid events

 Usage: perf stat [<options>] [<command>]

    -e, --event <event>   event selector. use 'perf list' to list available events
[root@...et bpf]# 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ