Patch "perf record: Check conflict between '--timestamp-filename' option and pipe mode before recording" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf record: Check conflict between '--timestamp-filename' option and pipe mode before recording

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-record-check-conflict-between-timestamp-filenam.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 83f8a60bd1e99be4342db34dbe228b0cdf6d6ff5
Author: Yang Jihong <yangjihong1@xxxxxxxxxx>
Date:   Fri Jan 19 04:03:03 2024 +0000

    perf record: Check conflict between '--timestamp-filename' option and pipe mode before recording
    
    [ Upstream commit 02f9b50e04812782fd006ed21c6da1c5e3e373da ]
    
    In pipe mode, no need to switch perf data output, therefore,
    '--timestamp-filename' option should not take effect.
    Check the conflict before recording and output WARNING.
    In this case, the check pipe mode in perf_data__switch() can be removed.
    
    Before:
    
      # perf record --timestamp-filename -o- perf test -w noploop | perf report -i- --percent-limit=1
      # To display the perf.data header info, please use --header/--header-only options.
      #
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Dump -.2024011812110182 ]
      #
      # Total Lost Samples: 0
      #
      # Samples: 4K of event 'cycles:P'
      # Event count (approx.): 2176784359
      #
      # Overhead  Command  Shared Object         Symbol
      # ........  .......  ....................  ......................................
      #
          97.83%  perf     perf                  [.] noploop
    
      #
      # (Tip: Print event counts in CSV format with: perf stat -x,)
      #
    
    After:
    
      # perf record --timestamp-filename -o- perf test -w noploop | perf report -i- --percent-limit=1
      WARNING: --timestamp-filename option is not available in pipe mode.
      # To display the perf.data header info, please use --header/--header-only options.
      #
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.000 MB - ]
      #
      # Total Lost Samples: 0
      #
      # Samples: 4K of event 'cycles:P'
      # Event count (approx.): 2185575421
      #
      # Overhead  Command  Shared Object          Symbol
      # ........  .......  .....................  .............................................
      #
          97.75%  perf     perf                   [.] noploop
    
      #
      # (Tip: Profiling branch (mis)predictions with: perf record -b / perf report)
      #
    
    Fixes: ecfd7a9c044e ("perf record: Add '--timestamp-filename' option to append timestamp to output file name")
    Signed-off-by: Yang Jihong <yangjihong1@xxxxxxxxxx>
    Acked-by: Namhyung Kim <namhyung@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240119040304.3708522-3-yangjihong1@xxxxxxxxxx
    Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 69d2d71e16ee8..c40460e936ccd 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -2417,6 +2417,11 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 	if (data->is_pipe && rec->evlist->core.nr_entries == 1)
 		rec->opts.sample_id = true;
 
+	if (rec->timestamp_filename && perf_data__is_pipe(data)) {
+		rec->timestamp_filename = false;
+		pr_warning("WARNING: --timestamp-filename option is not available in pipe mode.\n");
+	}
+
 	evlist__uniquify_name(rec->evlist);
 
 	/* Debug message used by test scripts */
diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c
index fc16299c915f9..851a9cd32c4a2 100644
--- a/tools/perf/util/data.c
+++ b/tools/perf/util/data.c
@@ -418,8 +418,6 @@ int perf_data__switch(struct perf_data *data,
 {
 	int ret;
 
-	if (check_pipe(data))
-		return -EINVAL;
 	if (perf_data__is_read(data))
 		return -EINVAL;
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux