public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Song Liu <songliubraving@fb.com>
Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, davidca@fb.com,
	jolsa@kernel.org, namhyung@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] perf: assign proper ff->ph in perf_event__synthesize_features()
Date: Sat, 6 Jul 2019 14:17:36 -0300	[thread overview]
Message-ID: <20190706171736.GD2093@redhat.com> (raw)
In-Reply-To: <20190620010453.4118689-1-songliubraving@fb.com>

Em Wed, Jun 19, 2019 at 06:04:53PM -0700, Song Liu escreveu:
> bpf/btf  write_* functions need ff->ph->env.
> 
> With this missing, pipe-mode (perf record -o -)  would crash like:
> 
> Program terminated with signal SIGSEGV, Segmentation fault.
> 
> This patch assign proper ph value to ff.

Thanks, applied.

- Arnaldo
 
> Cc: stable@vger.kernel.org #v5.1+
> Fixes: 606f972b1361 ("perf bpf: Save bpf_prog_info information as headers to perf.data")
> Reported-by: David Carrillo Cisneros <davidca@fb.com>
> Signed-off-by: Song Liu <songliubraving@fb.com>
> ---
>  tools/perf/util/header.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
> index 06ddb6618ef3..5f1aa0284e1b 100644
> --- a/tools/perf/util/header.c
> +++ b/tools/perf/util/header.c
> @@ -3684,6 +3684,7 @@ int perf_event__synthesize_features(struct perf_tool *tool,
>  		return -ENOMEM;
>  
>  	ff.size = sz - sz_hdr;
> +	ff.ph = &session->header;
>  
>  	for_each_set_bit(feat, header->adds_features, HEADER_FEAT_BITS) {
>  		if (!feat_ops[feat].synthesize) {
> -- 
> 2.17.1

  reply	other threads:[~2019-07-06 17:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20  1:04 [PATCH] perf: assign proper ff->ph in perf_event__synthesize_features() Song Liu
2019-07-06 17:17 ` Arnaldo Carvalho de Melo [this message]
2019-07-09 11:29 ` [tip:perf/core] perf header: Assign " tip-bot for Song Liu

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=20190706171736.GD2093@redhat.com \
    --to=acme@redhat.com \
    --cc=davidca@fb.com \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=stable@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox