All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
To: Sandipan Das <sandipan@linux.vnet.ibm.com>, acme@kernel.org
Cc: jolsa@redhat.com, linux-kernel@vger.kernel.org,
	naveen.n.rao@linux.vnet.ibm.com,
	ravi.bangoria@linux.vnet.ibm.com, sukadev@linux.vnet.ibm.com,
	maynard@us.ibm.com
Subject: Re: [PATCH v2 0/3] perf: Fixes for callchain ip handling on powerpc
Date: Thu, 19 Apr 2018 11:31:24 +0530	[thread overview]
Message-ID: <8c0d4deb-9bbd-1f19-94a3-ce2cded4fa10@linux.ibm.com> (raw)
In-Reply-To: <20180418105900.5899-1-sandipan@linux.vnet.ibm.com>



On 04/18/2018 04:28 PM, Sandipan Das wrote:
> The first patch fixes the callchain ip filtering mechanism for powerpc
> from skipping entries in case the LR value is still valid and yet to
> be written to the stack frame. This was previously posted as an RFC
> here: https://lkml.org/lkml/2018/4/4/633
>
> The second patch fixes a crash caused by attempting to access an empty
> callchain.
>
> The third patch fixes a shell test which used to fail on powerpc as
> the back trace from perf output did not match the expected pattern.
> Also, because of the issue described in the first patch, some entries
> from the callchain were incorrectly skipped. So, this has also been
> readjusted to work with the fix in the first patch.
>
> v2:
>  - Consider case when return address is in R0 as pointed out by Ravi.
>  - Add another patch to fix crash when callchain is empty.

Looks good. For the series,

Tested-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>

But there are few other cases, I've mentioned them in detail at the end,
which needs to be fixed. Arnaldo, if you are fine, can we push this series
and take care of other cases later on? No point in stretching this series.

I've used this simple test program to test it:

    int i = 10000000;
    void *ptr;

    while (i--) {
        ptr = malloc(i);
        free(ptr);
    }


Case 1:

Without Suka's and Sandipan's changes:

    perf  9207  3034.786828:   cycles:ppp:
                      10d66c power_pmu_enable (/lib/modules/4.17.0-rc1+/build/vmlinux)
                      2e4f24 perf_event_exec (/lib/modules/4.17.0-rc1+/build/vmlinux)            <===== This one
                      4096cc setup_new_exec (/lib/modules/4.17.0-rc1+/build/vmlinux)
                      494f38 load_elf_binary (/lib/modules/4.17.0-rc1+/build/vmlinux)
                      40842c search_binary_handler (/lib/modules/4.17.0-rc1+/build/vmlinux)
                      40924c do_execveat_common.isra.13 (/lib/modules/4.17.0-rc1+/build/vmlinux)
                      40981c sys_execve (/lib/modules/4.17.0-rc1+/build/vmlinux)
                       1b9e0 system_call (/lib/modules/4.17.0-rc1+/build/vmlinux)
                7fff9855b448 [unknown] ([unknown])

With only Suka's changes:

    perf  9207  3034.786828:   cycles:ppp:
                      10d66c power_pmu_enable (/lib/modules/4.17.0-rc1+/build/vmlinux)
                      4096cc setup_new_exec (/lib/modules/4.17.0-rc1+/build/vmlinux)
                      494f38 load_elf_binary (/lib/modules/4.17.0-rc1+/build/vmlinux)
                      40842c search_binary_handler (/lib/modules/4.17.0-rc1+/build/vmlinux)
                      40924c do_execveat_common.isra.13 (/lib/modules/4.17.0-rc1+/build/vmlinux)
                      40981c sys_execve (/lib/modules/4.17.0-rc1+/build/vmlinux)
                       1b9e0 system_call (/lib/modules/4.17.0-rc1+/build/vmlinux)
                7fff9855b448 [unknown] ([unknown])

With both Suka's and Sandipan's changes:

     perf  9207  3034.786828:   cycles:ppp:
                       10d66c power_pmu_enable (/lib/modules/4.17.0-rc1+/build/vmlinux)
                       4096cc setup_new_exec (/lib/modules/4.17.0-rc1+/build/vmlinux)
                       494f38 load_elf_binary (/lib/modules/4.17.0-rc1+/build/vmlinux)
                       40842c search_binary_handler (/lib/modules/4.17.0-rc1+/build/vmlinux)
                       40924c do_execveat_common.isra.13 (/lib/modules/4.17.0-rc1+/build/vmlinux)
                       40981c sys_execve (/lib/modules/4.17.0-rc1+/build/vmlinux)
                        1b9e0 system_call (/lib/modules/4.17.0-rc1+/build/vmlinux)
                 7fff9855b448 [unknown] ([unknown])
   
perf_event_exec() is a valid entry, which is missing in last two output.


Case 2:

Without Suka's and Sandipan's changes:

    1854.720942:     568814 cycles:ppp:
         9cf3c _int_malloc (/usr/lib64/libc-2.26.so)
         9f838 malloc (/usr/lib64/libc-2.26.so)            <===== This one
             0 [unknown] ([unknown])
           624 main (/home/ravi/Workspace/malloc)
         236a0 generic_start_main.isra.0 (/usr/lib64/libc-2.26.so)
         23898 __libc_start_main (/usr/lib64/libc-2.26.so)

With only Suka's changes:

    1854.720942:     568814 cycles:ppp:
         9cf3c _int_malloc (/usr/lib64/libc-2.26.so)
             0 [unknown] ([unknown])
           624 main (/home/ravi/Workspace/malloc)
         236a0 generic_start_main.isra.0 (/usr/lib64/libc-2.26.so)
         23898 __libc_start_main (/usr/lib64/libc-2.26.so)

With both Suka's and Sandipan's changes:

    1854.720942:     568814 cycles:ppp:
         9cf3c _int_malloc (/usr/lib64/libc-2.26.so)
             0 [unknown] ([unknown])
           624 main (/home/ravi/Workspace/malloc)
         236a0 generic_start_main.isra.0 (/usr/lib64/libc-2.26.so)
         23898 __libc_start_main (/usr/lib64/libc-2.26.so)

malloc() is missing in last two output. Also, the pattern I've observed is,
all samples where malloc() is missing is followed by  0 [unknown] ([unknown]).

Thanks,
Ravi

      parent reply	other threads:[~2018-04-19  6:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 10:58 [PATCH v2 0/3] perf: Fixes for callchain ip handling on powerpc Sandipan Das
2018-04-18 10:58 ` [PATCH v2 1/3] perf tools powerpc: Fix callchain ip filtering Sandipan Das
2018-04-18 10:58 ` [PATCH v2 2/3] perf tools powerpc: Fix crash if callchain is empty Sandipan Das
2018-04-18 10:59 ` [PATCH v2 3/3] perf tests: Fix record+probe_libc_inet_pton.sh for powerpc64 Sandipan Das
2018-04-18 17:53 ` [PATCH v2 0/3] perf: Fixes for callchain ip handling on powerpc Arnaldo Carvalho de Melo
2018-04-19  6:01 ` Ravi Bangoria [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c0d4deb-9bbd-1f19-94a3-ce2cded4fa10@linux.ibm.com \
    --to=ravi.bangoria@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maynard@us.ibm.com \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ravi.bangoria@linux.vnet.ibm.com \
    --cc=sandipan@linux.vnet.ibm.com \
    --cc=sukadev@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.