X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fperf%2Fbuiltin-sched.c;h=e3d3e32c0a934dc8fd5ce207073f3b80ecf4361a;hb=c64410f3eca037f831e9db7cf880e600acc841af;hp=0ee6d900e100a29ceeb3cacf7e97d81dce8f8d17;hpb=9589fcde27a6726b83bc525fba5c57e4b2c0328e;p=firefly-linux-kernel-4.4.55.git diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 0ee6d900e100..e3d3e32c0a93 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -1203,12 +1203,13 @@ static void output_lat_thread(struct perf_sched *sched, struct work_atoms *work_ static int pid_cmp(struct work_atoms *l, struct work_atoms *r) { + if (l->thread == r->thread) + return 0; if (l->thread->tid < r->thread->tid) return -1; if (l->thread->tid > r->thread->tid) return 1; - - return 0; + return (int)(l->thread - r->thread); } static int avg_cmp(struct work_atoms *l, struct work_atoms *r)