From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E975C6FD1C for ; Mon, 20 Mar 2023 22:25:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229583AbjCTWZs (ORCPT ); Mon, 20 Mar 2023 18:25:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbjCTWZr (ORCPT ); Mon, 20 Mar 2023 18:25:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C37231CAE4; Mon, 20 Mar 2023 15:25:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CC394B81106; Mon, 20 Mar 2023 22:24:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CE2EC433D2; Mon, 20 Mar 2023 22:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679351076; bh=JVOU84AlcZqGS6txTHxsZrMnzURkZ9tj2sVJblykpKk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eu40JiFDUnUSXH5yCF7+t29gZ6N/9P2QrbNYiDLGwA7AbN+WP1c0ZhRepBg1+oUDv xxu7xZli58Cjfzs4K/mZtQAp+k6RGqDnSix6ZTi1MhWMSmERT/1EA6yvdNbWA9yBAj Usrhdfd7Wh78V1ADeZNgIU/mw464Jatje/pPNji1kBwyQ8mpy0y01i83zHZY3zdsSr XmAGZhB+o1/KFYspIZAz5qXyS3knhen+TxoLrS0usxdehnu+JkyrEQGAjBXeEskjFM 4aECdGKqtcErhfvWlrNuugU1WAf0WJIAhMxVFsWpOeNBzraId+K8goMXHn4xC56AJa IK3CaKxsdkS0A== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id D1F9A4052D; Mon, 20 Mar 2023 19:24:33 -0300 (-03) Date: Mon, 20 Mar 2023 19:24:33 -0300 From: Arnaldo Carvalho de Melo To: "Bernhard M. Wiedemann" Cc: Ian Rogers , Ben Hutchings , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf jevents: Sort list of input files Message-ID: References: <20230320201841.1133-1-bwiedemann@suse.de> <5064f88a-952a-6f3f-f280-e76e09603c1b@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5064f88a-952a-6f3f-f280-e76e09603c1b@suse.de> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Em Mon, Mar 20, 2023 at 10:30:00PM +0100, Bernhard M. Wiedemann escreveu: > > > 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. So, Ian acked the current patch, but you found some further simplification, can you please resubmit? - Arnaldo