Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1530298 > unrolled thread

Re: [PATCH v2 1/2] perf sdt: add scanning of sdt probles arguments

Started byArnaldo Carvalho de Melo <acme@kernel.org>
First post2016-11-25 15:50 +0100
Last post2016-12-06 15:50 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 1/2] perf sdt: add scanning of sdt probles arguments Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-25 15:50 +0100
    [PATCH v4 0/2] perf probe: add sdt probes arguments into the uprobe cmd string Alexis Berlemont <alexis.berlemont@gmail.com> - 2016-11-26 02:10 +0100
      Re: [PATCH v4 0/2] perf probe: add sdt probes arguments into the  uprobe cmd string Alexis Berlemont <alexis.berlemont@gmail.com> - 2016-12-06 00:50 +0100
        Re: [PATCH v4 0/2] perf probe: add sdt probes arguments into the  uprobe cmd string Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-12-06 15:50 +0100

#1530298 — Re: [PATCH v2 1/2] perf sdt: add scanning of sdt probles arguments

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-11-25 15:50 +0100
SubjectRe: [PATCH v2 1/2] perf sdt: add scanning of sdt probles arguments
Message-ID<sHpZ8-1P4-37@gated-at.bofh.it>
Em Sat, Nov 19, 2016 at 12:56:36AM +0100, Alexis Berlemont escreveu:
> During a "perf buildid-cache --add" command, the section
> ".note.stapsdt" of the "added" binary is scanned in order to list the
> available SDT markers available in a binary. The parts containing the
> probes arguments were left unscanned.
> 
> The whole section is now parsed; the probe arguments are extracted for
> later use.
> 
> Signed-off-by: Alexis Berlemont <alexis.berlemont@gmail.com>
> ---
>  tools/perf/util/symbol-elf.c | 16 +++++++++++++++-
>  tools/perf/util/symbol.h     |  1 +
>  2 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
> index 99400b0..0fbe0b2 100644
> --- a/tools/perf/util/symbol-elf.c
> +++ b/tools/perf/util/symbol-elf.c
> @@ -1822,7 +1822,7 @@ void kcore_extract__delete(struct kcore_extract *kce)
>  static int populate_sdt_note(Elf **elf, const char *data, size_t len,
>  			     struct list_head *sdt_notes)
>  {
> -	const char *provider, *name;
> +	const char *provider, *name, *args;
>  	struct sdt_note *tmp = NULL;
>  	GElf_Ehdr ehdr;
>  	GElf_Addr base_off = 0;
> @@ -1881,6 +1881,20 @@ static int populate_sdt_note(Elf **elf, const char *data, size_t len,
>  		goto out_free_prov;
>  	}
>  
> +	args = (const char *)memchr(name, '\0', data + len - name);

Humm, no need for casting?

> +
> +	/*
> +	 * There is no argument if:
> +	 * - We reached the end of the note;
> +	 * - There is not enough room to hold a potential string;
> +	 * - The argument string is empty or just contains ':'.
> +	 */
> +	if (args == NULL || data + len - args < 2 ||
> +		args[1] == ':' || args[1] == '\0')
> +		tmp->args = NULL;
> +	else
> +		tmp->args = strdup(++args);

Shouldn't we check this and do error back propagation? I.e. if there are
args and we don't handle them, silently, that looks bad

> +
>  	if (gelf_getclass(*elf) == ELFCLASS32) {
>  		memcpy(&tmp->addr, &buf, 3 * sizeof(Elf32_Addr));
>  		tmp->bit32 = true;
> diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
> index 2d0a905..913be07 100644
> --- a/tools/perf/util/symbol.h
> +++ b/tools/perf/util/symbol.h
> @@ -347,6 +347,7 @@ int arch__choose_best_symbol(struct symbol *syma, struct symbol *symb);
>  struct sdt_note {
>  	char *name;			/* name of the note*/
>  	char *provider;			/* provider name */
> +	char *args;
>  	bool bit32;			/* whether the location is 32 bits? */
>  	union {				/* location, base and semaphore addrs */
>  		Elf64_Addr a64[3];
> -- 
> 2.10.2

[toc] | [next] | [standalone]


#1530580 — [PATCH v4 0/2] perf probe: add sdt probes arguments into the uprobe cmd string

FromAlexis Berlemont <alexis.berlemont@gmail.com>
Date2016-11-26 02:10 +0100
Subject[PATCH v4 0/2] perf probe: add sdt probes arguments into the uprobe cmd string
Message-ID<sHzF7-8am-5@gated-at.bofh.it>
In reply to#1530298
Hi Arnaldo,

Here is another patch set which fixes the issues you noticed.

Thank you.

Alexis.

Alexis Berlemont (2):
  perf sdt: add scanning of sdt probles arguments
  perf probe: add sdt probes arguments into the uprobe cmd string

 tools/perf/arch/x86/util/perf_regs.c |  18 ++++
 tools/perf/util/perf_regs.c          |   4 +
 tools/perf/util/perf_regs.h          |  13 +++
 tools/perf/util/probe-file.c         | 169 ++++++++++++++++++++++++++++++++++-
 tools/perf/util/symbol-elf.c         |  25 +++++-
 tools/perf/util/symbol.h             |   1 +
 6 files changed, 224 insertions(+), 6 deletions(-)

-- 
2.10.2

[toc] | [prev] | [next] | [standalone]


#1536530 — Re: [PATCH v4 0/2] perf probe: add sdt probes arguments into the uprobe cmd string

FromAlexis Berlemont <alexis.berlemont@gmail.com>
Date2016-12-06 00:50 +0100
SubjectRe: [PATCH v4 0/2] perf probe: add sdt probes arguments into the uprobe cmd string
Message-ID<sLbbb-2Fq-3@gated-at.bofh.it>
In reply to#1530580
Alexis Berlemont wrote:
> Hi Arnaldo,
> 
> Here is another patch set which fixes the issues you noticed.
>

Could you indicate me a way to improve these patches so as to move
forward ?

Regards,

Alexis.

> Thank you.
> 
> Alexis.
> 
> Alexis Berlemont (2):
>   perf sdt: add scanning of sdt probles arguments
>   perf probe: add sdt probes arguments into the uprobe cmd string
> 
>  tools/perf/arch/x86/util/perf_regs.c |  18 ++++
>  tools/perf/util/perf_regs.c          |   4 +
>  tools/perf/util/perf_regs.h          |  13 +++
>  tools/perf/util/probe-file.c         | 169 ++++++++++++++++++++++++++++++++++-
>  tools/perf/util/symbol-elf.c         |  25 +++++-
>  tools/perf/util/symbol.h             |   1 +
>  6 files changed, 224 insertions(+), 6 deletions(-)
> 
> -- 
> 2.10.2
> 

[toc] | [prev] | [next] | [standalone]


#1537015 — Re: [PATCH v4 0/2] perf probe: add sdt probes arguments into the uprobe cmd string

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-12-06 15:50 +0100
SubjectRe: [PATCH v4 0/2] perf probe: add sdt probes arguments into the uprobe cmd string
Message-ID<sLpea-3jz-21@gated-at.bofh.it>
In reply to#1536530
Em Tue, Dec 06, 2016 at 12:42:45AM +0100, Alexis Berlemont escreveu:
> Alexis Berlemont wrote:
> > Hi Arnaldo,
> > 
> > Here is another patch set which fixes the issues you noticed.
> >
> 
> Could you indicate me a way to improve these patches so as to move
> forward ?

Masami, Hemant, are you guys ok with this? Can I have your Acked-by or
Tested-by, etc?

- Arnaldo
 
> Regards,
> 
> Alexis.
> 
> > Thank you.
> > 
> > Alexis.
> > 
> > Alexis Berlemont (2):
> >   perf sdt: add scanning of sdt probles arguments
> >   perf probe: add sdt probes arguments into the uprobe cmd string
> > 
> >  tools/perf/arch/x86/util/perf_regs.c |  18 ++++
> >  tools/perf/util/perf_regs.c          |   4 +
> >  tools/perf/util/perf_regs.h          |  13 +++
> >  tools/perf/util/probe-file.c         | 169 ++++++++++++++++++++++++++++++++++-
> >  tools/perf/util/symbol-elf.c         |  25 +++++-
> >  tools/perf/util/symbol.h             |   1 +
> >  6 files changed, 224 insertions(+), 6 deletions(-)
> > 
> > -- 
> > 2.10.2
> > 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web