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 F3732C7EE24 for ; Mon, 5 Jun 2023 13:39:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230503AbjFENjD (ORCPT ); Mon, 5 Jun 2023 09:39:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230127AbjFENjC (ORCPT ); Mon, 5 Jun 2023 09:39:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAA2C92; Mon, 5 Jun 2023 06:39:01 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4E87C622B8; Mon, 5 Jun 2023 13:39:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77418C433D2; Mon, 5 Jun 2023 13:39:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685972340; bh=zmExzYudMwfGNEba20Z9ljtkQ0F7F9zZROAPpR26D08=; h=Date:From:To:Cc:Subject:From; b=hLtoQOW0x/ny+YqsSNDz9uHGIatddat8GP9vRUK7Y+Zzjv8DiYo/OLSXI37rttcfB wuHXW47vwDMMjAiwQJiX/IZCI/NN8E2JE+dftiZd+cUFCd6ZDCuNplc5l5fSGmhoVS OGbp4h37qRWTwXxYFn6uwF2ITXKstg9GB6vok4gTDh6lcPqcdg2+owbrmW4kDeZ2RF EIBASZBuNYItgUGrYaPYASp3M3m7IK/trTc/DPVFd8WKT2oHFAciLPUNGPRZMB+uPi TQh4fbH3OxgmOWbZFA1ldhap6qH/RPM3Es0HTB7PcJq8fXlSrmLdNYKFuOZnKbMwPS JKDvfMFJFYCYA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id F22EA40692; Mon, 5 Jun 2023 10:38:57 -0300 (-03) Date: Mon, 5 Jun 2023 10:38:57 -0300 From: Arnaldo Carvalho de Melo To: Davidlohr Bueso , Tiezhu Yang Cc: Namhyung Kim , Adrian Hunter , Andre Fredette , Clark Williams , Dave Tucker , Derek Barbosa , Ian Rogers , Jiri Olsa , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org Subject: [FYI PATCH 1/1] perf bench: Add missing setlocale() call to allow usage of %'d style formatting Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org FYI: I'm carrying this in the perf-tools-next branch, Thanks, - Arnaldo --- Without this we were not getting the thousands separator for big numbers. Noticed while developing 'perf bench uprobe', but the use of %' predates that, for instance 'perf bench syscall' uses it. Before: # perf bench uprobe all # Running uprobe/baseline benchmark... # Executed 1000 usleep(1000) calls Total time: 1054082243ns 1054082.243000 nsecs/op # After: # perf bench uprobe all # Running uprobe/baseline benchmark... # Executed 1,000 usleep(1000) calls Total time: 1,053,715,144ns 1,053,715.144000 nsecs/op # Fixes: c2a08203052f8975 ("perf bench: Add basic syscall benchmark") Cc: Adrian Hunter Cc: Andre Fredette Cc: Clark Williams Cc: Dave Tucker Cc: Davidlohr Bueso Cc: Derek Barbosa Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Tiezhu Yang Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-bench.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c index 58f1cfe1eb34b329..db435b791a09b69b 100644 --- a/tools/perf/builtin-bench.c +++ b/tools/perf/builtin-bench.c @@ -21,6 +21,7 @@ #include "builtin.h" #include "bench/bench.h" +#include #include #include #include @@ -260,6 +261,7 @@ int cmd_bench(int argc, const char **argv) /* Unbuffered output */ setvbuf(stdout, NULL, _IONBF, 0); + setlocale(LC_ALL, ""); if (argc < 2) { /* No collection specified. */ -- 2.37.1