public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>,
	David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>,
	Jan Stancek <jstancek@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH] perf tools: Fix "Command" sort_entry's cmp and collapse function
Date: Mon, 18 May 2015 16:39:53 +0200	[thread overview]
Message-ID: <20150518143953.GC528@krava.redhat.com> (raw)
In-Reply-To: <20150518013850.GA21663@sejong>

On Mon, May 18, 2015 at 10:38:50AM +0900, Namhyung Kim wrote:
> Hi Jiri,
> 
> CC-ing Frederic as he wrote the comm change.
> 
> On Fri, May 15, 2015 at 05:54:28PM +0200, Jiri Olsa wrote:
> > Currently the se_cmp and se_collapse use pointer comparison,
> > which is ok for for testing equality of strings. It's not ok
> > as comparing function for rbtree insertion, because it gives
> > different results based on current pointer values.
> > 
> > We saw test 32 (hists cumulation test) failing based on different
> > environment setup. Having all sort functions straightened fix the
> > test for us.
> 
> Can you elaborate it?
> 
> AFAIK comm string is shared among threads so pointer comparison and
> 'strcmp == 0' should have same result..

well pointers (A, B) substraction will get either negative (A < B) or
possitive number (A > B). Now if your environment happens to have those
pointers switched you'll get different result for same strings.

Following python script forced the 'perf test 32' to switch those pointers
and screwed the Command sorting.. it's not very reliable on upstream for
some reason.. but very reproducible on RHEL7

---
#!/bin/python

import os

env={}

env['PATH'] = "/tmp:"*500

os.execve("./perf", ["perf", "test", "32", "-v"], env)
---

jirka

      reply	other threads:[~2015-05-18 14:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15 15:54 [PATCH] perf tools: Fix "Command" sort_entry's cmp and collapse function Jiri Olsa
2015-05-18  1:38 ` Namhyung Kim
2015-05-18 14:39   ` Jiri Olsa [this message]

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=20150518143953.GC528@krava.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=jstancek@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox