All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: vmolnaro@redhat.com
Cc: linux-perf-users@vger.kernel.org, acme@redhat.com, mpetlan@redhat.com
Subject: Re: [PATCH 1/2] perf archive: Add new option '--all'
Date: Tue, 12 Dec 2023 15:06:47 -0300	[thread overview]
Message-ID: <ZXihN3th3qbo6L8Z@kernel.org> (raw)
In-Reply-To: <20231212165909.14459-1-vmolnaro@redhat.com>

Em Tue, Dec 12, 2023 at 05:59:08PM +0100, vmolnaro@redhat.com escreveu:
> From: Veronika Molnarova <vmolnaro@redhat.com>
> 
> Perf archive has limited functionality and people from Red Hat Global
> Support Services sent a request for a new feature that would pack
> perf.data file together with an archive with debug symbols created by
> the command 'perf archive' as customers were being confused and often
> would forget to send perf.data file with the debug symbols.
> 
> Perf archive now accepts an option '--all' that generates archive
> 'perf.all-hostname-date-time.tar.bz2' that holds file 'perf.data' and
> a sub-tar 'perf.symbols.tar.bz2' with debug symbols. The functionality of
> the command 'perf archive' was not changed.

Thanks for working on this, I'll do some testing and apply, probably
tomorrow.

- Arnaldo
 
> Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
> ---
>  tools/perf/perf-archive.sh | 40 ++++++++++++++++++++++++++++++--------
>  1 file changed, 32 insertions(+), 8 deletions(-)
>  mode change 100644 => 100755 tools/perf/perf-archive.sh
> 
> diff --git a/tools/perf/perf-archive.sh b/tools/perf/perf-archive.sh
> old mode 100644
> new mode 100755
> index 133f0eddbcc4..a92042eae95a
> --- a/tools/perf/perf-archive.sh
> +++ b/tools/perf/perf-archive.sh
> @@ -4,9 +4,19 @@
>  # Arnaldo Carvalho de Melo <acme@redhat.com>
>  
>  PERF_DATA=perf.data
> -if [ $# -ne 0 ] ; then
> -	PERF_DATA=$1
> -fi
> +PERF_SYMBOLS=perf.symbols
> +PERF_ALL=perf.all
> +ALL=0
> +
> +while [ $# -gt 0 ] ; do
> +	if [ $1 == "--all" ]; then
> +		ALL=1
> +		shift
> +	else
> +		PERF_DATA=$1
> +		shift
> +	fi
> +done
>  
>  #
>  # PERF_BUILDID_DIR environment variable set by perf
> @@ -39,9 +49,23 @@ while read build_id ; do
>  	echo ${filename#$PERF_BUILDID_LINKDIR} >> $MANIFEST
>  done
>  
> -tar cjf $PERF_DATA.tar.bz2 -C $PERF_BUILDID_DIR -T $MANIFEST
> -rm $MANIFEST $BUILDIDS || true
> -echo -e "Now please run:\n"
> -echo -e "$ tar xvf $PERF_DATA.tar.bz2 -C ~/.debug\n"
> -echo "wherever you need to run 'perf report' on."
> +if [ $ALL -eq 1 ]; then						# pack perf.data file together with tar containing debug symbols
> +	HOSTNAME=$(hostname)
> +	DATE=$(date '+%Y%m%d-%H%M%S')
> +	tar cjf $PERF_SYMBOLS.tar.bz2 -C $PERF_BUILDID_DIR -T $MANIFEST
> +	tar cjf	$PERF_ALL-$HOSTNAME-$DATE.tar.bz2 $PERF_DATA $PERF_SYMBOLS.tar.bz2
> +	rm $PERF_SYMBOLS.tar.bz2 $MANIFEST $BUILDIDS || true
> +
> +	echo -e "Now please run:\n"
> +	echo -e "$ tar xvf $PERF_ALL-$HOSTNAME-$DATE.tar.bz2 && tar xvf $PERF_SYMBOLS.tar.bz2 -C ~/.debug\n"
> +	echo "wherever you need to run 'perf report' on."
> +else										# pack only the debug symbols
> +	tar cjf $PERF_DATA.tar.bz2 -C $PERF_BUILDID_DIR -T $MANIFEST
> +	rm $MANIFEST $BUILDIDS || true
> +
> +	echo -e "Now please run:\n"
> +	echo -e "$ tar xvf $PERF_DATA.tar.bz2 -C ~/.debug\n"
> +	echo "wherever you need to run 'perf report' on."
> +fi
> +
>  exit 0
> -- 
> 2.43.0
> 

-- 

- Arnaldo

  parent reply	other threads:[~2023-12-12 18:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 16:59 [PATCH 1/2] perf archive: Add new option '--all' vmolnaro
2023-12-12 16:59 ` [PATCH 2/2] perf archive: Add new option '--unpack' vmolnaro
2023-12-12 18:06 ` Arnaldo Carvalho de Melo [this message]
2023-12-20 13:59   ` [PATCH 1/2] perf archive: Add new option '--all' Arnaldo Carvalho de Melo

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=ZXihN3th3qbo6L8Z@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=vmolnaro@redhat.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.