From: Ian Rogers <irogers@google.com>
To: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Cc: Ben Hutchings <benh@debian.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf jevents: Sort list of input files
Date: Mon, 20 Mar 2023 14:39:37 -0700 [thread overview]
Message-ID: <CAP-5=fXsY2BTkk2ugwq86n7OgqVXzG+n=pBGGpVDTixqyMC_Uw@mail.gmail.com> (raw)
In-Reply-To: <5064f88a-952a-6f3f-f280-e76e09603c1b@suse.de>
On Mon, Mar 20, 2023 at 2:30 PM Bernhard M. Wiedemann
<bwiedemann@suse.de> wrote:
>
> On 20/03/2023 21.48, Ian Rogers wrote:
> > I think this may already be addressed by sorting prior to output:
> > https://lore.kernel.org/r/20220812230949.683239-5-irogers@google.com
> >
> > Could you confirm?
>
> Hi Ian,
>
> I was testing on 6.2.6 which includes that patch and it was still affected.
> The trouble with sorting at the end is, that there can be influences of
> ordering in earlier processing steps, that don't get ironed out by the
> sort later.
>
> Some more experimenting showed that only the ftw scandir needed sorting,
> which allows to further simplify the patch to
>
> """Replicate the directory/file walking behavior of C's ...
> - for item in os.scandir(path):
> + for item in sorted(os.scandir(path), key=lambda e: e.name):
> action(parents, item)
>
>
> Without the patch, a random diff in pmu-events.c starts with
> -static const struct compact_pmu_event pme_amdzen2[] = {
> +static const struct compact_pmu_event pme_silvermont[] = {
>
>
> While I'm testing on scratch ext4 filesystems where dirindex causes
> randomness, you could also use the disorderfs FUSE-filesystem with its
> shuffle mode to give you random order.
>
> Ciao
> Bernhard M.
Thanks Bernhard!
Acked-by: Ian Rogers <irogers@google.com>
I wonder about determining the order from the mapfile.csv, but that's
another problem for another day.
Thanks,
Ian
next prev parent reply other threads:[~2023-03-20 21:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 20:18 [PATCH] perf jevents: Sort list of input files Bernhard M. Wiedemann
2023-03-20 20:48 ` Ian Rogers
2023-03-20 21:30 ` Bernhard M. Wiedemann
2023-03-20 21:39 ` Ian Rogers [this message]
2023-03-20 22:24 ` Arnaldo Carvalho de Melo
2023-03-21 6:30 ` Bernhard M. Wiedemann
2023-03-21 12:38 ` Arnaldo Carvalho de Melo
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='CAP-5=fXsY2BTkk2ugwq86n7OgqVXzG+n=pBGGpVDTixqyMC_Uw@mail.gmail.com' \
--to=irogers@google.com \
--cc=acme@kernel.org \
--cc=benh@debian.org \
--cc=bwiedemann@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).