Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4412400rdh; Wed, 29 Nov 2023 00:11:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeo1m51++BMX/VMlG/YZZgNvqHH6KOpZ4NOd5RmVOuhu5tPy90tuENjYKDXi5hBdlWCW9f X-Received: by 2002:a05:6808:1416:b0:3b8:4e37:42b with SMTP id w22-20020a056808141600b003b84e37042bmr24424556oiv.7.1701245461187; Wed, 29 Nov 2023 00:11:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701245461; cv=none; d=google.com; s=arc-20160816; b=m1mov+U8R+oK9lJMjFZkxAh23YmxAcWSNKb0ztL3a87RxHj7rYk02wjighWiPeyTjr KxUJoyQi+PQ9jWesN1i7cnI4JjehGjQaIpBigv7oic16f3+tX04xikmBU2KrKQayEs71 VIRL5O8jK9Unt8dD+yidYlRyPl4cORp5eqxqHoU+f2X9ljPiLwGRLCiHO5QvFtLSHthT nPlRwz4Ejq9rQRLrvp8A7JIX2uyBZuy7GAX2bVBjSJAYqggfRJKo/7dIWlUWx9sofg2t dhxPBajiKemX548KaMkYRv+tRwJnqbBsrr4zXpzBjW+gzH7Jey0Woe7Lt/3YVy6FtBiq Obfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:mime-version:message-id:date :dkim-signature; bh=cizzxjAOXVtNMhutvuRuFXeQ97rL+0eSPOInOH69jLw=; fh=OxO30iphCJ5T7Q0u7v9RAoN8TrpFE3bNOof1u+XBh30=; b=lrKZRpMz0IQuqtazYkQH9hbCa9qWWPVpxDnCroO/1tiL38jSqDMMGpQwT54Fvedrnw WDxJCmbuQ95YfLSAumolrgGkSWEfIKnlZ196ExkxjqOQU3Lgtg3EaIEn+FZJAWtbxNw/ F2I51KCqSAR7gunZakGg1okwt7Qjpz0vKNbZGkeqKfQIllrjNnlwZdZiIsfB3z4kj9BP U/hczPjd04eJlhEcMWTHpX9g3RhhmJFRo8VSaZoVdNoNL/5+gCNwv2EE6rJWDkg6KSVh RaxWcBVVXjixCwlM4dUpFqZkZqTZIYWpeU23W5ZDERHVYVNtvmfLqtGhCRHVgVRO3eXt qQ6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="X/snFXEy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id o126-20020a634184000000b005c1ccaca5c4si13581883pga.873.2023.11.29.00.11.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 00:11:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="X/snFXEy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BD40C807F48B; Wed, 29 Nov 2023 00:10:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbjK2IK0 (ORCPT + 99 others); Wed, 29 Nov 2023 03:10:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjK2IKY (ORCPT ); Wed, 29 Nov 2023 03:10:24 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B491D1990 for ; Wed, 29 Nov 2023 00:10:30 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-da39d244087so7772996276.3 for ; Wed, 29 Nov 2023 00:10:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701245430; x=1701850230; darn=vger.kernel.org; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=cizzxjAOXVtNMhutvuRuFXeQ97rL+0eSPOInOH69jLw=; b=X/snFXEy8faZNX6QoGJzhEUbNV1WjZARbZDPCvqBThRN12rlcWhd6juUuU6E+vfzIF HDnaayxQuUF+Wg33rLzJp0HqET17oiK+ooFXT1yuMAzRpaUSIpAwy71YUDItnPoNdh9T zVpN+dx/k/AY3od4+skeLV+Dv3aOsP0PGgniJTo5cvZU2RmfXGZRJgTs1y6szv57iXsj kYThJ24xeEQVP4oG979Pe/oPCrj5/8mHHO/nRFYIGRh6cqVG9y/ZxVlxvWIeetXt9qNC 1q9m9mUF1pCKhbIY3iAntfnnQBzOIHX5QfWv8JNc8DstLN72noFnuMCUiV5TSpzsMoTz lxLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701245430; x=1701850230; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cizzxjAOXVtNMhutvuRuFXeQ97rL+0eSPOInOH69jLw=; b=dV5iDfYEE5+ZKWtGYWQr5v3oDM6OaRUKV64H39Ogk9tvVw4UQTQD9hobeIjxoV6x5L mtgvvOo00GYFW/zHv+/fu6AODsH6SmRxRpCNdlzaMxbxQ0G/a/M66Jnoa1Yt6L4vIuVp G3C+P/9btHnd4vjHZDeKtJFXh1lbgauZBHPZDtUxIo2SBvMDLn6Tcexxwsk0ZLyNsZIo TousI0ySWkJ+0wdYJ2c6BBYcq+2uIc7YYZWt4oB9RFquJZXQdA/CbFSyc0wxHvXQvKOC MxQiggeaHPZLa93nsVAXBfM750KLI795M/CRdNzsJygmxmGYjj2EeLrATLd77pldJyi/ /pDg== X-Gm-Message-State: AOJu0Yy0NotXAzj2w1ZOxaN5W1FPa5Q4pw/BpZYOAG3Voo03Jrd+S6n1 h8SIbeyrl6XDL/LroQCBwpF6E9kwmb9V X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:763b:80fa:23ca:96f8]) (user=irogers job=sendgmr) by 2002:a25:ca04:0:b0:da3:a91c:7356 with SMTP id a4-20020a25ca04000000b00da3a91c7356mr440438ybg.8.1701245429912; Wed, 29 Nov 2023 00:10:29 -0800 (PST) Date: Wed, 29 Nov 2023 00:10:03 -0800 Message-Id: <20231129081004.1918096-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog Subject: [PATCH v1 1/2] perf list: Fix json segfault From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Kan Liang , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 29 Nov 2023 00:10:48 -0800 (PST) Json output didn't set the skip_duplicate_pmus callback yielding a segfault. Fixes: cd4e1efbbc40 ("perf pmus: Skip duplicate PMUs and don't print list suffix by default") Signed-off-by: Ian Rogers --- tools/perf/builtin-list.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c index a343823c8ddf..61c2c96cc070 100644 --- a/tools/perf/builtin-list.c +++ b/tools/perf/builtin-list.c @@ -434,6 +434,11 @@ static void json_print_metric(void *ps __maybe_unused, const char *group, strbuf_release(&buf); } +static bool json_skip_duplicate_pmus(void *ps __maybe_unused) +{ + return false; +} + static bool default_skip_duplicate_pmus(void *ps) { struct print_state *print_state = ps; @@ -503,6 +508,7 @@ int cmd_list(int argc, const char **argv) .print_end = json_print_end, .print_event = json_print_event, .print_metric = json_print_metric, + .skip_duplicate_pmus = json_skip_duplicate_pmus, }; ps = &json_ps; } else { -- 2.43.0.rc1.413.gea7ed67945-goog