Skip to contentSkip to conversation

Patch "perf diff: Fix -o/--order option behavior (again)" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Feb 13, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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

perf diff: Fix -o/--order option behavior (again)

to the 4.9-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-diff-fix-o-order-option-behavior-again.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From a1c9f97f0b64e6337d9cfcc08c134450934fdd90 Mon Sep 17 00:00:00 2001

From: Namhyung Kim <[email protected]>
Date: Wed, 18 Jan 2017 14:14:57 +0900
Subject: perf diff: Fix -o/--order option behavior (again)

From: Namhyung Kim <[email protected]>

commit a1c9f97f0b64e6337d9cfcc08c134450934fdd90 upstream.

Commit 21e6d8428664 ("perf diff: Use perf_hpp__register_sort_field interface") changed list_add() to perf_hpp__register_sort_field().

This resulted in a behavior change since the field was added to the tail instead of the head. So the -o option is mostly ignored due to its order in the list.

This patch fixes it by adding perf_hpp__prepend_sort_field().

Cc Peter Zijlstra <[email protected]>
Fixes 21e6d8428664 ("perf diff: Use perf_hpp__register_sort_field interface")
---
 tools/perf/builtin-diff.c |    2 +-
 tools/perf/ui/hist.c      |    6 ++++++
 tools/perf/util/hist.h    |    7 +++++++
 3 files changed, 14 insertions(+), 1 deletion(-)
tools/perf/builtin-diff.c +1 -1
@@ -1199,7 +1199,7 @@ static int ui_init(void)
 		BUG_ON(1);
 	}
 
-	perf_hpp__register_sort_field(fmt);
+	perf_hpp__prepend_sort_field(fmt);
 	return 0;
 }
 
tools/perf/ui/hist.c +6 -0
@@ -521,6 +521,12 @@ void perf_hpp_list__register_sort_field(
 	list_add_tail(&format->sort_list, &list->sorts);
 }
 
+void perf_hpp_list__prepend_sort_field(struct perf_hpp_list *list,
+				       struct perf_hpp_fmt *format)
+{
+	list_add(&format->sort_list, &list->sorts);
+}
+
 void perf_hpp__column_unregister(struct perf_hpp_fmt *format)
 {
 	list_del(&format->list);
tools/perf/util/hist.h +7 -0
@@ -282,6 +282,8 @@ void perf_hpp_list__column_register(stru
 				    struct perf_hpp_fmt *format);
 void perf_hpp_list__register_sort_field(struct perf_hpp_list *list,
 					struct perf_hpp_fmt *format);
+void perf_hpp_list__prepend_sort_field(struct perf_hpp_list *list,
+				       struct perf_hpp_fmt *format);
 
 static inline void perf_hpp__column_register(struct perf_hpp_fmt *format)
 {
@@ -293,6 +295,11 @@ static inline void perf_hpp__register_so
 	perf_hpp_list__register_sort_field(&perf_hpp_list, format);
 }
 
+static inline void perf_hpp__prepend_sort_field(struct perf_hpp_fmt *format)
+{
+	perf_hpp_list__prepend_sort_field(&perf_hpp_list, format);
+}
+
 #define perf_hpp_list__for_each_format(_list, format) \
 	list_for_each_entry(format, &(_list)->fields, list)
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/perf-diff-fix-segfault-on-perf-diff-o-n-option.patch queue-4.9/perf-diff-fix-o-order-option-behavior-again.patch