All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Namhyung Kim <namhyung@kernel.org>,
	Waiman Long <Waiman.Long@hp.com>,
	Stephane Eranian <eranian@google.com>,
	Jiri Olsa <jolsa@redhat.com>, David Ahern <dsahern@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] perf: Support for Openembedded/Yocto -dbg packages
Date: Wed, 18 Sep 2013 15:34:00 +0200	[thread overview]
Message-ID: <20130918133400.GA8141@gmail.com> (raw)
In-Reply-To: <1379497571-14208-1-git-send-email-ricardo.ribalda@gmail.com>


* Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> wrote:

> On OpenEmbedded the symbol files are located under a .debug folder on
> the same folder as the binary file.
> 
> This patch adds support for such files.
> 
> Without this patch on perf top you can see:
> 
> no symbols found in /usr/lib/gstreamer-1.0/libtheoraenc.so.1.1.2, maybe install
> a debug package?
> 
> 84.56%  libtheoraenc.so.1.1.2       [.] 0x000000000000b346
> 
> With this patch symbols are shown:
> 
> 19.06%  libtheoraenc.so.1.1.2       [.] oc_int_frag_satd_thresh_mmxext
> 9.76%   libtheoraenc.so.1.1.2       [.] oc_analyze_mb_mode_luma
> 5.58%   libtheoraenc.so.1.1.2       [.] oc_qii_state_advance
> 4.84%   libtheoraenc.so.1.1.2       [.] oc_enc_tokenize_ac
> ...

Nice! Two nits are remaining:

> @@ -64,6 +65,21 @@ int dso__binary_type_file(struct dso *dso, enum dso_binary_type type,
>  			 symbol_conf.symfs, dso->long_name);
>  		break;
>  
> +	case DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO:{

I think you missed the review feedback I gave for this line in the 
previous mail.

> +		char *last_slash;
> +
> +		last_slash = dso->long_name + dso->long_name_len;
> +		while (last_slash != dso->long_name && *last_slash != '/')
> +			last_slash--;
> +
> +		size -= snprintf(file, MIN(size, strlen(symbol_conf.symfs) +
> +				(last_slash - dso->long_name) + 2), "%s%s",
> +				symbol_conf.symfs, dso->long_name);
> +		snprintf(file + strlen(file), size, ".debug%s",
> +				last_slash);
> +		break;
> +	}

The 'MIN' still looks superfluous (btw., we use min()) - why not simply 
set 'size' to the correct value when you set and iterate last_slash?

(and scnprintf() should be used, as Arnaldo suggested.)

Thanks,

	Ingo

      reply	other threads:[~2013-09-18 13:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18  9:46 [PATCH v2] perf: Support for Openembedded/Yocto -dbg packages Ricardo Ribalda Delgado
2013-09-18 13:34 ` Ingo Molnar [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=20130918133400.GA8141@gmail.com \
    --to=mingo@kernel.org \
    --cc=Waiman.Long@hp.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=ricardo.ribalda@gmail.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.