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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6B21C10F1A for ; Tue, 7 May 2024 22:27:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 186D66B0093; Tue, 7 May 2024 18:27:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1375A6B0099; Tue, 7 May 2024 18:27:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F418A6B009E; Tue, 7 May 2024 18:27:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id D26516B009B for ; Tue, 7 May 2024 18:27:35 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 84E4BC0395 for ; Tue, 7 May 2024 22:27:35 +0000 (UTC) X-FDA: 82093037670.03.A40686F Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf09.hostedemail.com (Postfix) with ESMTP id AE3C214001B for ; Tue, 7 May 2024 22:27:33 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of namhyung@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=namhyung@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715120853; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t5X7mhLCQAPvf9UJYurWF6MZ4a0PGMgJ3oHaQ7skRzQ=; b=JAgSBisVS4+/a3AJW7A/wyjQqCSQcx9KIGDsI3IaIbsI1KAJFS1mcfkvamFmy8MyQWoaqO fvulkWAhljJtlAq9926hlOtn/1HmRFrz2q8kwg9pW5BFrfr7EBd6mVi7zgty4AYhcHpY3N dBfR7NAZEiNL8MyM+Jiz8SdA4lF2sgk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715120853; a=rsa-sha256; cv=none; b=GdkAwbGHrJt5r+1YGr4aLqU2VjgudssSjvgxpa2oRiPCjHpVVEFryZzynlVGFaqCX9Ul9s HnHWe3yXAxYAXhsKcU2Uwd33EARdQ4LflmjyhtdiOGoWTY90Bqom53peZlE/SGXoZ9Q1ws inlmanWMoYMQbyhLmQQOe0Uic/PZS0U= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of namhyung@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=namhyung@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2b3c711dfd3so2867195a91.2 for ; Tue, 07 May 2024 15:27:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715120853; x=1715725653; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t5X7mhLCQAPvf9UJYurWF6MZ4a0PGMgJ3oHaQ7skRzQ=; b=lI/NGJQKy+cTtZaAMz5AnCu1Netc65+9aKoe3x75gqFe4m63aq1rki4StBl26Q3qtB 1KWO6I+WE20ae79OYvFaJZD3W8NRlCRTmysxOKKhsyWveFLyG0YbUOZ3awpnxBDHsXZz 00oMtqPIBAhG3RKMgQIdE9aYjzRsC39iA3Pi8ikv+UUHVcZFHHcIm5poKUPF2+tas61V OmW0U4TXZHntHPdKVE3raJb1jRwMoLaQuAaYK9NcwylUIUSex2/aY1zb2K8rLVj/1Dxn Fs5BUz4BM4ISkzs/utNHGW7Go7WUOqsspWOfdr3zHU4D5ykE1t1GRXkwlBtKyt5cuPjT A18Q== X-Forwarded-Encrypted: i=1; AJvYcCV4uA95d5H7q8NGpcxYIldu3wA9O1aC2eBmb9OEMObaEaL1j02Hg4VLwkTcJZM5vXZHM2vP6bSJm1GXaehlBQ6MufI= X-Gm-Message-State: AOJu0YxDaICCacTsU5bWa3tZDLsqBVCzVG7Zzb1Gr5QKjQLvq7yoA2wx ep/w50tlLlNcA2mpHfeTeqsUwQt4yGogM1INxvx1M5NcMX6po9bU5ZjancFcjVvxy5+Ou9IoRmW z+xmaxmGXOfSuoFrxLPWbcuceqL8= X-Google-Smtp-Source: AGHT+IEI2iBjGsSm/jmmFvlkhywBbG2wjmqIDdAcjH0lE6lVLSaKRGjeWcb6bNRpbExj2FjfgzPSBheUFBHkoKAfvdE= X-Received: by 2002:a17:90b:1882:b0:2b6:1711:9e08 with SMTP id 98e67ed59e1d1-2b617119ea2mr846653a91.43.1715120852514; Tue, 07 May 2024 15:27:32 -0700 (PDT) MIME-Version: 1.0 References: <20240504003006.3303334-1-andrii@kernel.org> <20240504003006.3303334-6-andrii@kernel.org> <2024050404-rectify-romp-4fdb@gregkh> In-Reply-To: From: Namhyung Kim Date: Tue, 7 May 2024 15:27:21 -0700 Message-ID: Subject: Re: [PATCH 5/5] selftests/bpf: a simple benchmark tool for /proc//maps APIs To: Andrii Nakryiko Cc: Ian Rogers , Greg KH , Andrii Nakryiko , linux-fsdevel@vger.kernel.org, brauner@kernel.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org, Arnaldo Carvalho de Melo , "linux-perf-use." Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Stat-Signature: bh67xxhqfan1s6dwmf6firyemthij4hu X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: AE3C214001B X-HE-Tag: 1715120853-110969 X-HE-Meta: U2FsdGVkX1/pI9UB5TnAqOknnsup4cPtITvlr2AG3CrsvAjxCGs7HAbk3IZ752fo92hnWuF1+DbSY9SwVph7L5k131yQJu99AZm034M7YQl9E0P3LFvNZ4DU5T3jtROK3DslqeXMuzvh+k7OErLnB6vQFY+rm2BArNxuUt6FqAsfL/O0im5uogBGgxoh4LSn8cqNa8gCk6KO28afEK8oc9+2McFXhHHHWTDHPdJ9OA8HGbGHybCj+h5VpOwF6Q107Y1Cps7C2IKQsEAMY+9M//3tnRqnBlcJW/mCkM/HNnnCAHBCJ3DzPs51Pku0ZhWOdMoKCwrvP+D6rFnB2VnBmXdHQoZle3GutP6VdUeM1/pV7ORlSuPCcFguThdgFju4d6fRACnj2qBhD3Ip1iaj06encl+bjLyfF6mlwvbZEX5/A3vOrMgPatthSgsc31zxA2bpZ+uD7/UgDwK4lei/sMFFt4USMYOe29SeK+vKQzm3UQetuHN4EUYB9gKU2HBcf7Tl/NPvArTzhQ2wVd9eSGGgf14XyXqkRqqAesHIJUPpytlepLfiuJEhez0jyVYuOLn/+TR6F+Z8mgBPS6GpR5+KzTUqXrUFILwPd/GblNgtuJ57qiU7PXG2kPdjKLJ4je9HelrGjcWVW6v6DH2z7KZHHxlUVJs0Mle86eOcc0eeAi+fszedo9xZ3oeSMm0+Tpn1uCZJKesm6iwmr9DeA/cTFYevjxSi+gwEImV63rBU1ePtfQzKJgmDipNektrxO30FoChXOqOtktV34DfLRLJFuSvY/c5CU6tXvUxtjGLtyaOX046+32uclgh+v6u3sNzlNJ7W4i0Psr+e3wqeBsxFRTlt0EPa9zMyU1AYTmeA67jmNm7mhz6ws0wS7q+w74jYVT8HMCRwKGKrSg3RZCz4/9WdQW+UnnewNBD21NtQA8/lc5Ees4WssutEYmOhl0xuJRVJcBhZmGwIvg1 5Ju8mnH7 YE75L9R6G+Bibfb4M/7LQP2upf1yKEZYV8OJCGJIStPphBhhaHXaAUEUFGKvxX0rMux/JKn7uWFJeo+YuV529RHUdiDlht57a9PCqQ1C8BGnaGraIZiSqyTvQnHUOiHqDnZGtP+WF1MP0EQZGoJfltt2LjEaahzDKlfcATPNWSEpk3DeyU7FjMy8sA6RUtaMgsCL5nrLhJDZ5nUsE6RnO3UuUbLf4z5AiUj8J87FNMeXnNX1zRTtDogUmAiC9C2Cz6i8bg5H22Bk0b4c4NAFejHLx2nId8208w6Bwts6PLJF+JB2X+MkxGKlsIUC//DMdj9oRKjBPvXcAGvZIQRvwT9z6x2VB3O8yDN8MobEPFiuyOK2tvh7B9Q+HAGoCXZWY5D6ObE68iGzvcEI7mximhE+PoM/qtZNFeXN8u/PI+5SviTSoye8UyTc6GCnuXTsMsvcnTEBTEBM6jEFNX1jAWGG7EyUhYorEnS3K+znXFbtnhdkBdbv2IyiudCk7BRuQx5TH53/JbS8PcGs7NOH2BoX6jYtS38NE0gPCjnFtCwwFi9B6t3B9ixcJtJvv36KOSzUlYbyFTC6AZpOtCiO353qSTIvbBUxV1+is X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, May 7, 2024 at 10:29=E2=80=AFAM Andrii Nakryiko wrote: > > On Mon, May 6, 2024 at 10:06=E2=80=AFPM Andrii Nakryiko > wrote: > > > > On Mon, May 6, 2024 at 11:43=E2=80=AFAM Ian Rogers = wrote: > > > > > > On Mon, May 6, 2024 at 11:32=E2=80=AFAM Andrii Nakryiko > > > wrote: > > > > > > > > On Sat, May 4, 2024 at 10:09=E2=80=AFPM Ian Rogers wrote: > > > > > > > > > > On Sat, May 4, 2024 at 2:57=E2=80=AFPM Andrii Nakryiko > > > > > wrote: > > > > > > > > > > > > On Sat, May 4, 2024 at 8:29=E2=80=AFAM Greg KH wrote: > > > > > > > > > > > > > > On Fri, May 03, 2024 at 05:30:06PM -0700, Andrii Nakryiko wro= te: > > > > > > > > Implement a simple tool/benchmark for comparing address "re= solution" > > > > > > > > logic based on textual /proc//maps interface and new b= inary > > > > > > > > ioctl-based PROCFS_PROCMAP_QUERY command. > > > > > > > > > > > > > > Of course an artificial benchmark of "read a whole file" vs. = "a tiny > > > > > > > ioctl" is going to be different, but step back and show how t= his is > > > > > > > going to be used in the real world overall. Pounding on this= file is > > > > > > > not a normal operation, right? > > > > > > > > > > > > > > > > > > > It's not artificial at all. It's *exactly* what, say, blazesym = library > > > > > > is doing (see [0], it's Rust and part of the overall library AP= I, I > > > > > > think C code in this patch is way easier to follow for someone = not > > > > > > familiar with implementation of blazesym, but both implementati= ons are > > > > > > doing exactly the same sequence of steps). You can do it even l= ess > > > > > > efficiently by parsing the whole file, building an in-memory lo= okup > > > > > > table, then looking up addresses one by one. But that's even sl= ower > > > > > > and more memory-hungry. So I didn't even bother implementing th= at, it > > > > > > would put /proc//maps at even more disadvantage. > > > > > > > > > > > > Other applications that deal with stack traces (including perf)= would > > > > > > be doing one of those two approaches, depending on circumstance= s and > > > > > > level of sophistication of code (and sensitivity to performance= ). > > > > > > > > > > The code in perf doing this is here: > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi= t/tree/tools/perf/util/synthetic-events.c#n440 > > > > > The code is using the api/io.h code: > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi= t/tree/tools/lib/api/io.h > > > > > Using perf to profile perf it was observed time was spent allocat= ing > > > > > buffers and locale related activities when using stdio, so io is = a > > > > > lighter weight alternative, albeit with more verbose code than fs= canf. > > > > > You could add this as an alternate /proc//maps reader, we ha= ve a > > > > > similar benchmark in `perf bench internals synthesize`. > > > > > > > > > > > > > If I add a new implementation using this ioctl() into > > > > perf_event__synthesize_mmap_events(), will it be tested from this > > > > `perf bench internals synthesize`? I'm not too familiar with perf c= ode > > > > organization, sorry if it's a stupid question. If not, where exactl= y > > > > is the code that would be triggered from benchmark? > > > > > > Yes it would be triggered :-) > > > > Ok, I don't exactly know how to interpret the results (and what the > > benchmark is doing), but numbers don't seem to be worse. They actually > > seem to be a bit better. > > > > I pushed my code that adds perf integration to [0]. That commit has > > results, but I'll post them here (with invocation parameters). > > perf-ioctl is the version with ioctl()-based implementation, > > perf-parse is, logically, text-parsing version. Here are the results > > (and see my notes below the results as well): > > > > TEXT-BASED > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > # ./perf-parse bench internals synthesize > > # Running 'internals/synthesize' benchmark: > > Computing performance of single threaded perf event synthesis by > > synthesizing events on the perf process itself: > > Average synthesis took: 80.311 usec (+- 0.077 usec) > > Average num. events: 32.000 (+- 0.000) > > Average time per event 2.510 usec > > Average data synthesis took: 84.429 usec (+- 0.066 usec) > > Average num. events: 179.000 (+- 0.000) > > Average time per event 0.472 usec > > > > # ./perf-parse bench internals synthesize > > # Running 'internals/synthesize' benchmark: > > Computing performance of single threaded perf event synthesis by > > synthesizing events on the perf process itself: > > Average synthesis took: 79.900 usec (+- 0.077 usec) > > Average num. events: 32.000 (+- 0.000) > > Average time per event 2.497 usec > > Average data synthesis took: 84.832 usec (+- 0.074 usec) > > Average num. events: 180.000 (+- 0.000) > > Average time per event 0.471 usec > > > > # ./perf-parse bench internals synthesize --mt -M 8 > > # Running 'internals/synthesize' benchmark: > > Computing performance of multi threaded perf event synthesis by > > synthesizing events on CPU 0: > > Number of synthesis threads: 1 > > Average synthesis took: 36338.100 usec (+- 406.091 usec) > > Average num. events: 14091.300 (+- 7.433) > > Average time per event 2.579 usec > > Number of synthesis threads: 2 > > Average synthesis took: 37071.200 usec (+- 746.498 usec) > > Average num. events: 14085.900 (+- 1.900) > > Average time per event 2.632 usec > > Number of synthesis threads: 3 > > Average synthesis took: 33932.300 usec (+- 626.861 usec) > > Average num. events: 14085.900 (+- 1.900) > > Average time per event 2.409 usec > > Number of synthesis threads: 4 > > Average synthesis took: 33822.700 usec (+- 506.290 usec) > > Average num. events: 14099.200 (+- 8.761) > > Average time per event 2.399 usec > > Number of synthesis threads: 5 > > Average synthesis took: 33348.200 usec (+- 389.771 usec) > > Average num. events: 14085.900 (+- 1.900) > > Average time per event 2.367 usec > > Number of synthesis threads: 6 > > Average synthesis took: 33269.600 usec (+- 350.341 usec) > > Average num. events: 14084.000 (+- 0.000) > > Average time per event 2.362 usec > > Number of synthesis threads: 7 > > Average synthesis took: 32663.900 usec (+- 338.870 usec) > > Average num. events: 14085.900 (+- 1.900) > > Average time per event 2.319 usec > > Number of synthesis threads: 8 > > Average synthesis took: 32748.400 usec (+- 285.450 usec) > > Average num. events: 14085.900 (+- 1.900) > > Average time per event 2.325 usec > > > > IOCTL-BASED > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > # ./perf-ioctl bench internals synthesize > > # Running 'internals/synthesize' benchmark: > > Computing performance of single threaded perf event synthesis by > > synthesizing events on the perf process itself: > > Average synthesis took: 72.996 usec (+- 0.076 usec) > > Average num. events: 31.000 (+- 0.000) > > Average time per event 2.355 usec > > Average data synthesis took: 79.067 usec (+- 0.074 usec) > > Average num. events: 178.000 (+- 0.000) > > Average time per event 0.444 usec > > > > # ./perf-ioctl bench internals synthesize > > # Running 'internals/synthesize' benchmark: > > Computing performance of single threaded perf event synthesis by > > synthesizing events on the perf process itself: > > Average synthesis took: 73.921 usec (+- 0.073 usec) > > Average num. events: 31.000 (+- 0.000) > > Average time per event 2.385 usec > > Average data synthesis took: 80.545 usec (+- 0.070 usec) > > Average num. events: 178.000 (+- 0.000) > > Average time per event 0.453 usec > > > > # ./perf-ioctl bench internals synthesize --mt -M 8 > > # Running 'internals/synthesize' benchmark: > > Computing performance of multi threaded perf event synthesis by > > synthesizing events on CPU 0: > > Number of synthesis threads: 1 > > Average synthesis took: 35609.500 usec (+- 428.576 usec) > > Average num. events: 14040.700 (+- 1.700) > > Average time per event 2.536 usec > > Number of synthesis threads: 2 > > Average synthesis took: 34293.800 usec (+- 453.811 usec) > > Average num. events: 14040.700 (+- 1.700) > > Average time per event 2.442 usec > > Number of synthesis threads: 3 > > Average synthesis took: 32385.200 usec (+- 363.106 usec) > > Average num. events: 14040.700 (+- 1.700) > > Average time per event 2.307 usec > > Number of synthesis threads: 4 > > Average synthesis took: 33113.100 usec (+- 553.931 usec) > > Average num. events: 14054.500 (+- 11.469) > > Average time per event 2.356 usec > > Number of synthesis threads: 5 > > Average synthesis took: 31600.600 usec (+- 297.349 usec) > > Average num. events: 14012.500 (+- 4.590) > > Average time per event 2.255 usec > > Number of synthesis threads: 6 > > Average synthesis took: 32309.900 usec (+- 472.225 usec) > > Average num. events: 14004.000 (+- 0.000) > > Average time per event 2.307 usec > > Number of synthesis threads: 7 > > Average synthesis took: 31400.100 usec (+- 206.261 usec) > > Average num. events: 14004.800 (+- 0.800) > > Average time per event 2.242 usec > > Number of synthesis threads: 8 > > Average synthesis took: 31601.400 usec (+- 303.350 usec) > > Average num. events: 14005.700 (+- 1.700) > > Average time per event 2.256 usec > > > > I also double-checked (using strace) that it does what it is supposed > > to do, and it seems like everything checks out. Here's text-based > > strace log: > > > > openat(AT_FDCWD, "/proc/35876/task/35876/maps", O_RDONLY) =3D 3 > > read(3, "00400000-0040c000 r--p 00000000 "..., 8192) =3D 3997 > > read(3, "7f519d4d3000-7f519d516000 r--p 0"..., 8192) =3D 4025 > > read(3, "7f519dc3d000-7f519dc44000 r-xp 0"..., 8192) =3D 4048 > > read(3, "7f519dd2d000-7f519dd2f000 r--p 0"..., 8192) =3D 4017 > > read(3, "7f519dff6000-7f519dff8000 r--p 0"..., 8192) =3D 2744 > > read(3, "", 8192) =3D 0 > > close(3) =3D 0 > > > > > > BTW, note how the kernel doesn't serve more than 4KB of data, even > > though perf provides 8KB buffer (that's to Greg's question about > > optimizing using bigger buffers, I suspect without seq_file changes, > > it won't work). > > > > And here's an abbreviated log for ioctl version, it has lots more (but > > much faster) ioctl() syscalls, given it dumps everything: > > > > openat(AT_FDCWD, "/proc/36380/task/36380/maps", O_RDONLY) =3D 3 > > ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0x9f, 0x1, 0x60), 0x7fff6b603d50) = =3D 0 > > ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0x9f, 0x1, 0x60), 0x7fff6b603d50) = =3D 0 > > > > ... 195 ioctl() calls in total ... > > > > ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0x9f, 0x1, 0x60), 0x7fff6b603d50) = =3D 0 > > ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0x9f, 0x1, 0x60), 0x7fff6b603d50) = =3D 0 > > ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0x9f, 0x1, 0x60), 0x7fff6b603d50) = =3D 0 > > ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0x9f, 0x1, 0x60), 0x7fff6b603d50) > > =3D -1 ENOENT (No such file or directory) > > close(3) =3D 0 > > > > > > So, it's not the optimal usage of this API, and yet it's still better > > (or at least not worse) than text-based API. It's surprising that more ioctl is cheaper than less read and parse. > > > > In another reply to Arnaldo on patch #2 I mentioned the idea of > allowing to iterate only file-backed VMAs (as it seems like what > symbolizers would only care about, but I might be wrong here). So I Yep, I think it's enough to get file-backed VMAs only. > tried that quickly, given it's a trivial addition to my code. See > results below (it is slightly faster, but not much, because most of > VMAs in that benchmark seem to be indeed file-backed anyways), just > for completeness. I'm not sure if that would be useful/used by perf, > so please let me know. Thanks for doing this. It'd be useful as it provides better synthesizing performance. The startup latency of perf record is a problem, I need to take a look if it can be improved more. Thanks, Namhyung > > As I mentioned above, it's not radically faster in this perf > benchmark, because we still request about 170 VMAs (vs ~195 if we > iterate *all* of them), so not a big change. The ratio will vary > depending on what the process is doing, of course. Anyways, just for > completeness, I'm not sure if I have to add this "filter" to the > actual implementation. > > # ./perf-filebacked bench internals synthesize > # Running 'internals/synthesize' benchmark: > Computing performance of single threaded perf event synthesis by > synthesizing events on the perf process itself: > Average synthesis took: 65.759 usec (+- 0.063 usec) > Average num. events: 30.000 (+- 0.000) > Average time per event 2.192 usec > Average data synthesis took: 73.840 usec (+- 0.080 usec) > Average num. events: 153.000 (+- 0.000) > Average time per event 0.483 usec > > # ./perf-filebacked bench internals synthesize > # Running 'internals/synthesize' benchmark: > Computing performance of single threaded perf event synthesis by > synthesizing events on the perf process itself: > Average synthesis took: 66.245 usec (+- 0.059 usec) > Average num. events: 30.000 (+- 0.000) > Average time per event 2.208 usec > Average data synthesis took: 70.627 usec (+- 0.074 usec) > Average num. events: 153.000 (+- 0.000) > Average time per event 0.462 usec > > # ./perf-filebacked bench internals synthesize --mt -M 8 > # Running 'internals/synthesize' benchmark: > Computing performance of multi threaded perf event synthesis by > synthesizing events on CPU 0: > Number of synthesis threads: 1 > Average synthesis took: 33477.500 usec (+- 556.102 usec) > Average num. events: 10125.700 (+- 1.620) > Average time per event 3.306 usec > Number of synthesis threads: 2 > Average synthesis took: 30473.700 usec (+- 221.933 usec) > Average num. events: 10127.000 (+- 0.000) > Average time per event 3.009 usec > Number of synthesis threads: 3 > Average synthesis took: 29775.200 usec (+- 315.212 usec) > Average num. events: 10128.700 (+- 0.667) > Average time per event 2.940 usec > Number of synthesis threads: 4 > Average synthesis took: 29477.100 usec (+- 621.258 usec) > Average num. events: 10129.000 (+- 0.000) > Average time per event 2.910 usec > Number of synthesis threads: 5 > Average synthesis took: 29777.900 usec (+- 294.710 usec) > Average num. events: 10144.700 (+- 11.597) > Average time per event 2.935 usec > Number of synthesis threads: 6 > Average synthesis took: 27774.700 usec (+- 357.569 usec) > Average num. events: 10158.500 (+- 14.710) > Average time per event 2.734 usec > Number of synthesis threads: 7 > Average synthesis took: 27437.200 usec (+- 233.626 usec) > Average num. events: 10135.700 (+- 2.700) > Average time per event 2.707 usec > Number of synthesis threads: 8 > Average synthesis took: 28784.600 usec (+- 477.630 usec) > Average num. events: 10133.000 (+- 0.000) > Average time per event 2.841 usec > > > [0] https://github.com/anakryiko/linux/commit/0841fe675ed30f5605c5b22= 8e18f5612ea253b35 > > > > > > > > Thanks, > > > Ian > > > > > > > > Thanks, > > > > > Ian > > > > > > > > > > > [0] https://github.com/libbpf/blazesym/blob/ee9b48a80c0b44991= 18a1e8e5d901cddb2b33ab1/src/normalize/user.rs#L193 > > > > > > > > > > > > > thanks, > > > > > > > > > > > > > > greg k-h > > > > > > >