From nobody Sat Feb 7 09:24:23 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18E221667FA; Fri, 21 Jun 2024 17:05:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718989530; cv=none; b=GlqfvJe5Q00wHyxU0H3BGRPR4edwKe8HcwEbnWuvZDgvJZ/U8yrwPA1tYhVvnA5BUJMpYJjoIh8BXJ04I14/H/SMAat/lgvqD30PTwmMGKZLtzqtJrS6+baE0HkAJDEQZ0VUufXOHKBsqmCmxOjJukZPPN7+85mVdUWFBNbqkT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718989530; c=relaxed/simple; bh=itpttj0NdgxQo+wKm+pbsZ28jiNm/YdbN+BgrhdkQdE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a9rekXTUpx9nsYOx7Pk34ddT1cvNe35W+f0+bnZoO6z7JzUv390PvrDIOwB4DAGRiaXrCxh4MuKFBqQOPiWtuQc94LPaSjOSwIDDgHXiqQF0R0H41l4ihKSs4P581Pm7RO1F0wsLP9XnAnxbtyhPyVE4diaPDfn6+8saScCgu5Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NkakOuf+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NkakOuf+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 606D8C4AF0B; Fri, 21 Jun 2024 17:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718989529; bh=itpttj0NdgxQo+wKm+pbsZ28jiNm/YdbN+BgrhdkQdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NkakOuf+ziYIO+6+s9dZAD8bg2DQ+rbA3l0FWUHbCCH1DEzYJfqtchSj0gGmsZ/iJ L8ya7DpjzTGXe7e+PVQbriCdtR+mtTmAHUt/0Xyl5fxowsCFQ6ROt1UOjGbSyn3aXc nJBtEaAAZ0nPlIJpTBufD1Du17utgyhlTfk5MgMBEDRifMOwusezkRLr9cuh4mw6NM +vsyDmM2ihV9y1aHOLtVadt5oqpB/BvY04CnrjqjiBPDWW1SM8hB7gcLUe8eFBgFrf qQf87FpJ0/Qe82dvUxhsNA4EzFT2d0CrZzf2QPbdWjQEPqpCOPfvU2b06OsqOnc5tV 0pvDq2e9UyjlA== From: Namhyung Kim To: Arnaldo Carvalho de Melo , Ian Rogers , Kan Liang Cc: Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: [PATCH 1/4] perf report: Fix condition in sort__sym_cmp() Date: Fri, 21 Jun 2024 10:05:25 -0700 Message-ID: <20240621170528.608772-2-namhyung@kernel.org> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog In-Reply-To: <20240621170528.608772-1-namhyung@kernel.org> References: <20240621170528.608772-1-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It's expected that both hist entries are in the same hists when comparing two. But the current code in the function checks one without dso sort key and other with the key. This would make the condition true in any case. I guess the intention of the original commit was to add '!' for the right side too. But as it should be the same, let's just remove it. Fixes: 69849fc5d2119 ("perf hists: Move sort__has_dso into struct perf_hpp_= list") Signed-off-by: Namhyung Kim Reviewed-by: Kan Liang --- tools/perf/util/sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index cd39ea972193..ab7c7ff35f9b 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -334,7 +334,7 @@ sort__sym_cmp(struct hist_entry *left, struct hist_entr= y *right) * comparing symbol address alone is not enough since it's a * relative address within a dso. */ - if (!hists__has(left->hists, dso) || hists__has(right->hists, dso)) { + if (!hists__has(left->hists, dso)) { ret =3D sort__dso_cmp(left, right); if (ret !=3D 0) return ret; --=20 2.45.2.741.gdbec12cfda-goog From nobody Sat Feb 7 09:24:23 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52597168494; Fri, 21 Jun 2024 17:05:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718989530; cv=none; b=sDrvczbPab+cw8a1o4+csiWxo4QirmhAq018OlgM4D0mdT1Ds+yOjR0v4LijYJliw8PADc01ccbMlNf0wAAmQG+xlpqkbSJA7fiJkDfH+tkgXi1ltaXyGceCRcoN5LZu4pyB1bSlIcab1aeEvtssf/yztAH3t7KWJwIuCJuhxYw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718989530; c=relaxed/simple; bh=g6aPZ50JX5Sd5rVkOHN+CrZUoDyYQBCQxeejaCtTyEk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q9DmlDNuY2qzQSAD400Y8EEgNOhccaCl2vx7ITVov33IVX7GoC+BQje+7LH0glg1nes72URDXUkDh42hml3Ft73TtgwCX2pTD45DuRmnP4WEpA0r4jsL7l/ell+dhad92obC9pOnjcg0DfC582s6K3KTaC8yeQjnmXmjMkvqidA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lcKEuwOL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lcKEuwOL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D80B3C4AF07; Fri, 21 Jun 2024 17:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718989530; bh=g6aPZ50JX5Sd5rVkOHN+CrZUoDyYQBCQxeejaCtTyEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lcKEuwOL1p0XtVmHvI81ylA8aHLprZ8RCqBp5n4ihpaGzU1uBnKzE3qGWcbAg4aRw lb61XQQ0KKIQzjh20PNwurQSyywaj3quEP7sdiZOilfcFWanQURAF+dbKVhlcYPy5T tNlOVBU4czg8wrQPlRgxqeEh7MPoHwfwvKNz3aUSq5w2doxXIqy/KdtvuCmWe7qWwP uM9tggW3uOFb6qBgydjf9XLCUIUmMhNGoqRK7mwJ0hnVtUzWWEgf48Hz0+z6UYUzKw ObM2t9KM47+DWK2qBNetvtImFe1xoTPDi59MPKvGP1yEpECMipuLm3NVUWGPT6lALI 0t1fVux+LK+OQ== From: Namhyung Kim To: Arnaldo Carvalho de Melo , Ian Rogers , Kan Liang Cc: Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: [PATCH 2/4] perf symbol: Simplify kernel module checking Date: Fri, 21 Jun 2024 10:05:26 -0700 Message-ID: <20240621170528.608772-3-namhyung@kernel.org> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog In-Reply-To: <20240621170528.608772-1-namhyung@kernel.org> References: <20240621170528.608772-1-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In dso__load(), it checks if the dso is a kernel module by looking the symtab type. Actually dso has 'is_kmod' field to check that easily and dso__set_module_info() set the symtab type and the is_kmod bit. So it should have the same result to check the is_kmod bit. Signed-off-by: Namhyung Kim Reviewed-by: Kan Liang --- tools/perf/util/symbol.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 8e2da48eeaf0..25dfad79b5d7 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1816,10 +1816,7 @@ int dso__load(struct dso *dso, struct map *map) goto out; } =20 - kmod =3D dso__symtab_type(dso) =3D=3D DSO_BINARY_TYPE__SYSTEM_PATH_KMODUL= E || - dso__symtab_type(dso) =3D=3D DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP || - dso__symtab_type(dso) =3D=3D DSO_BINARY_TYPE__GUEST_KMODULE || - dso__symtab_type(dso) =3D=3D DSO_BINARY_TYPE__GUEST_KMODULE_COMP; + kmod =3D dso__is_kmod(dso); =20 if (dso__kernel(dso) && !kmod) { if (dso__kernel(dso) =3D=3D DSO_SPACE__KERNEL) --=20 2.45.2.741.gdbec12cfda-goog From nobody Sat Feb 7 09:24:23 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDFA716A396; Fri, 21 Jun 2024 17:05:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718989531; cv=none; b=lFs/kihTOlRCYU5jxnWD4GkD4x/FJF/ueAu7kSGew1+WmkQ+XAuzNAPjl6ppKOtbXd9YLZRRXleTmoFZ5s6Hzm6gYPa+Hq7rqylDZ7JfgkvtlKDDYck7/bNCHjduCSQjLlqqG5QiV1gRZQrfDlSoTjdlK69KOAhMy5/Rjd66OBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718989531; c=relaxed/simple; bh=0emI+LOLxaFN5d1DG4aJdzE5Lez+85IG7IvfurAWcCU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SpxK5Xc5gaxHT4gJ+NrFUb4MI8UubLz8/922esclJTVEZK46vUXErFX1Ie4jq5Edza5vkj/k8a/PT8NqEIdUUlCDSyEYb0mla6u6eu/L3Ry+F43au/QoeCTynb9j0EBKT97saR4ZCV1+0IRWoiN0qh+epByY7apDdN8rX5+NYFI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WPdnMXuI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WPdnMXuI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A68CC4AF0B; Fri, 21 Jun 2024 17:05:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718989530; bh=0emI+LOLxaFN5d1DG4aJdzE5Lez+85IG7IvfurAWcCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WPdnMXuIuSmp4ASEdY9K3ToUu+Cspc8FAVr4lwRfc46iUnDO0sjj4YULdKvn7B6P7 chrKkyF2VrieRbABTqI/Ldmhphh8cD2BRITyRHSf/66Gahk7D7pLwO8x97En83ZLnn S6ntp38hTE2Ie7kjL2sO55KoHRKYxDzekFzpO7s58ARMiFKY5+vJKjr9W6PT1dTiAi pCwUyF5B09Vqmv+LIXbeZaNYvhJlhOK5hC+VgXujQdg5oKUwcE6tJS6mMKViphRi3y oUX9HtAUTKQr9GJdeMxtVsWyaPtKSOaZqOLlmVpUECBXz04ban+9lAekEUEUIviSed 61/b43+CIzEAA== From: Namhyung Kim To: Arnaldo Carvalho de Melo , Ian Rogers , Kan Liang Cc: Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, kernel test robot Subject: [PATCH 3/4] perf tools: Fix a compiler warning of NULL pointer Date: Fri, 21 Jun 2024 10:05:27 -0700 Message-ID: <20240621170528.608772-4-namhyung@kernel.org> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog In-Reply-To: <20240621170528.608772-1-namhyung@kernel.org> References: <20240621170528.608772-1-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" A compiler warning on the second argument of bsearch() should not be NULL, but there's a case we might pass it. Let's return early if we don't have any DSOs to search in __dsos__find_by_longname_id(). util/dsos.c:184:8: runtime error: null pointer passed as argument 2, whic= h is declared to never be null Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202406180932.84be448c-oliver.sang@in= tel.com Signed-off-by: Namhyung Kim Reviewed-by: Kan Liang --- tools/perf/util/dsos.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/util/dsos.c b/tools/perf/util/dsos.c index ab3d0c01dd63..d5d78bdc56b2 100644 --- a/tools/perf/util/dsos.c +++ b/tools/perf/util/dsos.c @@ -164,6 +164,9 @@ static struct dso *__dsos__find_by_longname_id(struct d= sos *dsos, }; struct dso **res; =20 + if (dsos->dsos =3D=3D NULL) + return NULL; + if (!dsos->sorted) { if (!write_locked) { struct dso *dso; --=20 2.45.2.741.gdbec12cfda-goog From nobody Sat Feb 7 09:24:23 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EEB416A95B; Fri, 21 Jun 2024 17:05:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718989531; cv=none; b=FHQbW+bPj/nIVzWksjc9scd+mO0lnlYHVgHayQHxVamEUjUqU2d3LGLBRDOLzAWzxrGyk6vV9JsHmltcuS7mVAM81rFIxoR7OrS6vahQfiK9CXs9vtHLKS6IJz3qyOjECAnrTXIOKUbozaDvnAeoy9/YFq5fNkNRoeQetvm8ius= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718989531; c=relaxed/simple; bh=d2u6CluNqHWjqRE3vn1x6VOO63b45+Y8ceccB7kIFCM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uVBZbC+RhpjwdvF9AfA+TWatcQpZlRP4iiGZgU03k5fruOAMOv/mdTEVVOWNCFKKqhghWDOP1V4gSdt+Fsv0W8Bh08Mbb6dWg0dqm6VstyRAMglmYEnAdB7l18Ei7mVZYSiFs3ta0vx3vHo0LY3ydZk2lpVIGmvGxd/D8SQ7mOI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fTkouqiZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fTkouqiZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCD27C4AF0E; Fri, 21 Jun 2024 17:05:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718989531; bh=d2u6CluNqHWjqRE3vn1x6VOO63b45+Y8ceccB7kIFCM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fTkouqiZnuAGHXwk5EWiMu5ZY91p5sVNhyjOw10zoC4mfXBWcU5BqPao73tVcYBoS 52LVfNooO6iQYpaNhf2Bdj4ODjiyhp3ikZWXCJsh7Kqin+RWLlFG026QVWorm5Re7K 2LyQU/GUAXnRCHzgqb8IYBVUY/FbUBBZrsQ8Rjo/EJsmXQViTUTm2Yceaabn7IkOaR Cnj+0Oqypi8Xr68rvAuVT1YM0swIG6UNME9ar6NjyItwmJ6LsKo9YIWFVx/fWnncp6 U4fUjuqxtbvncio8dfQgAQGfSnn+YtUXlSUD0ir3/UHhguPvXBgrHhfw4IezDzdyGX C5NeZU7GtfSIA== From: Namhyung Kim To: Arnaldo Carvalho de Melo , Ian Rogers , Kan Liang Cc: Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Guilherme Amadio Subject: [PATCH 4/4] perf mem: Fix a segfault with NULL event->name Date: Fri, 21 Jun 2024 10:05:28 -0700 Message-ID: <20240621170528.608772-5-namhyung@kernel.org> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog In-Reply-To: <20240621170528.608772-1-namhyung@kernel.org> References: <20240621170528.608772-1-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Guilherme reported a crash in perf mem record. It's because the perf_mem_event->name was NULL on his machine. It should just return a NULL string when it has no format string in the name. But I'm not sure why it returns TRUE if it doesn't have event_name in perf_pmu__mem_events_supported(). The backtrace at the crash is below: Program received signal SIGSEGV, Segmentation fault. __strchrnul_avx2 () at ../sysdeps/x86_64/multiarch/strchr-avx2.S:67 67 vmovdqu (%rdi), %ymm2 (gdb) bt #0 __strchrnul_avx2 () at ../sysdeps/x86_64/multiarch/strchr-avx2.S:67 #1 0x00007ffff6c982de in __find_specmb (format=3D0x0) at printf-parse.h:= 82 #2 __printf_buffer (buf=3Dbuf@entry=3D0x7fffffffc760, format=3Dformat@en= try=3D0x0, ap=3Dap@entry=3D0x7fffffffc880, mode_flags=3Dmode_flags@entry=3D0) at vfprintf-internal.c:649 #3 0x00007ffff6cb7840 in __vsnprintf_internal (string=3D,= maxlen=3D, format=3D0x0, args=3D0x7fffffffc880, mode_flags=3Dmode_flags@entry=3D0) at vsnprint= f.c:96 #4 0x00007ffff6cb787f in ___vsnprintf (string=3D, maxlen= =3D, format=3D, args=3D) at vsnprintf.c:103 #5 0x00005555557b9391 in scnprintf (buf=3D0x555555fe9320 "", size=3D100, fmt=3D0x0) at ../lib/vsprintf.c:21 #6 0x00005555557b74c3 in perf_pmu__mem_events_name (i=3D0, pmu=3D0x55555= 6832180) at util/mem-events.c:106 #7 0x00005555557b7ab9 in perf_mem_events__record_args (rec_argv=3D0x5555= 5684c000, argv_nr=3D0x7fffffffca20) at util/mem-events.c:252 #8 0x00005555555e370d in __cmd_record (argc=3D3, argv=3D0x7fffffffd760, = mem=3D0x7fffffffcd80) at builtin-mem.c:156 #9 0x00005555555e49c4 in cmd_mem (argc=3D4, argv=3D0x7fffffffd760) at bu= iltin-mem.c:514 #10 0x000055555569716c in run_builtin (p=3D0x555555fcde80 ,= argc=3D8, argv=3D0x7fffffffd760) at perf.c:349 #11 0x0000555555697402 in handle_internal_command (argc=3D8, argv=3D0x7ff= fffffd760) at perf.c:402 #12 0x0000555555697560 in run_argv (argcp=3D0x7fffffffd59c, argv=3D0x7fff= ffffd590) at perf.c:446 #13 0x00005555556978a6 in main (argc=3D8, argv=3D0x7fffffffd760) at perf.= c:562 Reported-by: Guilherme Amadio Closes: https://lore.kernel.org/linux-perf-users/Zlns_o_IE5L28168@cern.ch Signed-off-by: Namhyung Kim Reviewed-by: Kan Liang --- tools/perf/util/mem-events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c index 6dda47bb774f..429079329e48 100644 --- a/tools/perf/util/mem-events.c +++ b/tools/perf/util/mem-events.c @@ -86,7 +86,7 @@ static const char *perf_pmu__mem_events_name(int i, struc= t perf_pmu *pmu) return NULL; =20 e =3D &pmu->mem_events[i]; - if (!e) + if (!e || !e->name) return NULL; =20 if (i =3D=3D PERF_MEM_EVENTS__LOAD || i =3D=3D PERF_MEM_EVENTS__LOAD_STOR= E) { --=20 2.45.2.741.gdbec12cfda-goog