aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/stdio/hist.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-07-20 14:27:39 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-07-20 14:46:10 -0400
commit8e99b6d4533cf3f49dcd813155a513a5b572baef (patch)
treef3f082ab6d3e1916353b59e7f70735183cc72722 /tools/perf/ui/stdio/hist.c
parent082ab9a18e532864d1ceecfb50221df62b1d5a92 (diff)
tools include: Adopt strstarts() from the kernel
Replacing prefixcmp(), same purpose, inverted result, so standardize on the kernel variant, to reduce silly differences among tools/ and the kernel sources, making it easier for people to work in both codebases. And then doing: if (strstarts(option, "no-")) Looks clearer than doing: if (!prefixcmp(option, "no-")) To figure out if option starts witn "no-". Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-kaei42gi7lpa8subwtv7eug8@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/stdio/hist.c')
-rw-r--r--tools/perf/ui/stdio/hist.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 2df8eb1ed3c0..5c95b8301c67 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -1,4 +1,5 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <linux/string.h>
2 3
3#include "../../util/util.h" 4#include "../../util/util.h"
4#include "../../util/hist.h" 5#include "../../util/hist.h"
@@ -292,7 +293,7 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root,
292 * displayed twice. 293 * displayed twice.
293 */ 294 */
294 if (!i++ && field_order == NULL && 295 if (!i++ && field_order == NULL &&
295 sort_order && !prefixcmp(sort_order, "sym")) 296 sort_order && strstarts(sort_order, "sym"))
296 continue; 297 continue;
297 298
298 if (!printed) { 299 if (!printed) {