From: Namhyung Kim <namhyung@kernel.org>
To: Tianyou Li <tianyou.li@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
wangyang.guo@intel.com, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add --buildids-blacklist option to perf archive command
Date: Tue, 24 Jun 2025 11:49:46 -0700 [thread overview]
Message-ID: <aFrzSpvzzWeHdyJ5@google.com> (raw)
In-Reply-To: <20250609035542.2364525-1-tianyou.li@intel.com>
Hello,
On Mon, Jun 09, 2025 at 11:55:42AM +0800, Tianyou Li wrote:
> When make a perf archive, it may contains the binaries that user did not want to ship with,
> add --buildids-blacklist option to specify a backlist file which contains the buildids need
> to be excluded. The blacklist file can be generated from command:
>
> perf buildid-list -i perf.data --with-hits | grep -v "^ " > buildids_blacklist.txt
>
> Then remove the lines from the buildids_blacklist.txt for buildids should be included.
Instead of blacklist, how about saying it like "--exclude-buildids"?
>
> Signed-off-by: Tianyou Li <tianyou.li@intel.com>
> Reviewed-by: Wangyang Guo <wangyang.guo@intel.com>
> ---
> tools/perf/perf-archive.sh | 35 ++++++++++++++++++++++++++++++-----
> 1 file changed, 30 insertions(+), 5 deletions(-)
>
> diff --git a/tools/perf/perf-archive.sh b/tools/perf/perf-archive.sh
> index 6ed7e52ab881..e5ff840ac6b4 100755
> --- a/tools/perf/perf-archive.sh
> +++ b/tools/perf/perf-archive.sh
> @@ -16,6 +16,13 @@ while [ $# -gt 0 ] ; do
> elif [ $1 == "--unpack" ]; then
> UNPACK=1
> shift
> + elif [ $1 == "--buildids-blacklist" ]; then
> + BUILDIDS_BLACKLIST="$2"
> + if [ ! -e "$BUILDIDS_BLACKLIST" ]; then
> + echo "Provided buildids blacklist file $BUILDIDS_BLACKLIST does not exist"
> + exit 1
> + fi
> + shift 2
> else
> PERF_DATA=$1
> UNPACK_TAR=$1
> @@ -86,11 +93,29 @@ fi
>
> BUILDIDS=$(mktemp /tmp/perf-archive-buildids.XXXXXX)
>
> -perf buildid-list -i $PERF_DATA --with-hits | grep -v "^ " > $BUILDIDS
> -if [ ! -s $BUILDIDS ] ; then
> - echo "perf archive: no build-ids found"
> - rm $BUILDIDS || true
> - exit 1
> +#
> +# BUILDIDS_BLACKLIST is an optional file that contains build-ids to be excluded from the
> +# archive. It is a list of build-ids, one per line, without any leading or trailing spaces.
> +# If the file is empty, all build-ids will be included in the archive. To create a blacklist
> +# file, you can use the following command:
> +# perf buildid-list -i perf.data --with-hits | grep -v "^ " > buildids_blacklist.txt
> +# You can edit the file to remove the lines that you want to keep in the archive, then:
> +# perf archive --buildids-blacklist buildids_blacklist.txt
Then you'll need to update the comment here.
Thanks,
Namhyung
> +#
> +if [ ! -s $BUILDIDS_BLACKLIST ]; then
> + perf buildid-list -i $PERF_DATA --with-hits | grep -v "^ " > $BUILDIDS
> + if [ ! -s $BUILDIDS ] ; then
> + echo "perf archive: no build-ids found"
> + rm $BUILDIDS || true
> + exit 1
> + fi
> +else
> + perf buildid-list -i $PERF_DATA --with-hits | grep -v "^ " | grep -Fv -f $BUILDIDS_BLACKLIST > $BUILDIDS
> + if [ ! -s $BUILDIDS ] ; then
> + echo "perf archive: no build-ids found after applying blacklist"
> + rm $BUILDIDS || true
> + exit 1
> + fi
> fi
>
> MANIFEST=$(mktemp /tmp/perf-archive-manifest.XXXXXX)
> --
> 2.47.1
>
next prev parent reply other threads:[~2025-06-24 18:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-09 3:55 Tianyou Li
2025-06-24 18:49 ` Namhyung Kim [this message]
2025-06-25 15:28 ` Li, Tianyou
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=aFrzSpvzzWeHdyJ5@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tianyou.li@intel.com \
--cc=wangyang.guo@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®