Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751154AbbEXNbb (ORCPT ); Sun, 24 May 2015 09:31:31 -0400 Received: from mail9.hitachi.co.jp ([133.145.228.44]:56611 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751018AbbEXNba (ORCPT ); Sun, 24 May 2015 09:31:30 -0400 Message-ID: <5561D2A9.6020209@hitachi.com> Date: Sun, 24 May 2015 22:31:21 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: He Kuang , wangnan0@huawei.com, paulus@samba.org, a.p.zijlstra@chello.nl, mingo@redhat.com, acme@kernel.org, namhyung@kernel.org, jolsa@kernel.org, ast@plumgrid.com, dsahern@gmail.com, brendan.d.gregg@gmail.com, daniel@iogearbox.net CC: lizefan@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2 03/15] perf bpf: Save pt_regs info from debuginfo References: <1432456091-73384-1-git-send-email-hekuang@huawei.com> <1432456091-73384-4-git-send-email-hekuang@huawei.com> In-Reply-To: <1432456091-73384-4-git-send-email-hekuang@huawei.com> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3217 Lines: 98 On 2015/05/24 17:27, He Kuang wrote: > Save reg number in function convert_variable_location() instead of the > register string name, so we can fetch the target register from bpf > context register later. This is not needed because you can also get reg number from reg string afterwards. Thank you, > > Signed-off-by: He Kuang > --- > tools/perf/util/include/dwarf-regs.h | 13 +++++++++++++ > tools/perf/util/probe-event.h | 1 + > tools/perf/util/probe-finder.c | 11 +++++++++++ > 3 files changed, 25 insertions(+) > > diff --git a/tools/perf/util/include/dwarf-regs.h b/tools/perf/util/include/dwarf-regs.h > index 8f14965..566ff6d 100644 > --- a/tools/perf/util/include/dwarf-regs.h > +++ b/tools/perf/util/include/dwarf-regs.h > @@ -2,7 +2,20 @@ > #define _PERF_DWARF_REGS_H_ > > #ifdef HAVE_DWARF_SUPPORT > +struct arch_regs_info { > + const char *name; /* Architecture dependent register string */ > + int offset; /* Reg offset in struct pt_regs */ > + int size; /* Reg size */ > +}; > + > +#define ARCH_REGS_INFO(r, pt_reg_name) \ > + {.name = r, \ > + .offset = offsetof(struct pt_regs, pt_reg_name), \ > + .size = sizeof(((struct pt_regs *)0)->pt_reg_name)} \ > + > const char *get_arch_regstr(unsigned int n); > +int get_arch_reg_offset(unsigned int n); > +int get_arch_reg_size(unsigned int n); > #endif > > #endif > diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h > index d6b7834..6c19395 100644 > --- a/tools/perf/util/probe-event.h > +++ b/tools/perf/util/probe-event.h > @@ -29,6 +29,7 @@ struct probe_trace_arg { > char *value; /* Base value */ > char *type; /* Type name */ > struct probe_trace_arg_ref *ref; /* Referencing offset */ > + unsigned int regn; /* Regn from dwarf */ > }; > > /* kprobe-tracer and uprobe-tracer tracing event (point + arg) */ > diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c > index ee27b74..681af00 100644 > --- a/tools/perf/util/probe-finder.c > +++ b/tools/perf/util/probe-finder.c > @@ -159,6 +159,16 @@ static struct probe_trace_arg_ref *alloc_trace_arg_ref(long offs) > return ref; > } > > +int __attribute__ ((weak)) > +get_arch_reg_offset(unsigned int n __maybe_unused) { > + return -1; > +} > + > +int __attribute__ ((weak)) > +get_arch_reg_size(unsigned int n __maybe_unused) { > + return -1; > +} > + > /* > * Convert a location into trace_arg. > * If tvar == NULL, this just checks variable can be converted. > @@ -260,6 +270,7 @@ static_var: > return -ERANGE; > } > > + tvar->regn = regn; > tvar->value = strdup(regs); > if (tvar->value == NULL) > return -ENOMEM; > -- Masami HIRAMATSU Linux Technology Research Center, System Productivity Research Dept. Center for Technology Innovation - Systems Engineering Hitachi, Ltd., Research & Development Group E-mail: masami.hiramatsu.pt@hitachi.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/