Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp256558lqo; Tue, 7 May 2024 20:53:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXUi2GjhNij0MCLhc3WAJ4yGExxQ+eGTaX+gGlrUvOY3g8Q9uBfAx7H4ALMBB45C/2Vl7UJ/oyZGQPha78UfBSvNKgYIx3afnu2sJWIEQ== X-Google-Smtp-Source: AGHT+IF3WKMDWxgXSizYazUKAf/efukoJJW+R+AYXEDIVGEA0QtDwjqQQNjy/686iLIl7Zw3gu4/ X-Received: by 2002:a17:907:74b:b0:a5a:5c5:a9f7 with SMTP id a640c23a62f3a-a5a05c5aeefmr10186966b.8.1715140431502; Tue, 07 May 2024 20:53:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715140431; cv=pass; d=google.com; s=arc-20160816; b=lJD3G/O5QMi2JMelkzOLFExK9cv3KS7Fodl24L5YkRuR7u1pT4vrfRmy18PjWIYmPj tn8/LXN2FvRdge0MsGZlqVuM5UbxFGZfpW06NUG96GYDCzWGdRdldnO8mlIJkH8KWdMI 688Hd/EDoHcnRzASKO5Wo3rQTHvqWZuXBkRbf+CXUkMJ81c15WxdPl52PzTMEypPVrSw IiV1K3Ry4QLEEtTSSBkJas+9MokZzYEZsCwGHwLLPdBA3kkeZ52e8mLcCE+HGsrCbs0/ 2Gbd9vXVwK6aCZxKywI3NycYokI7NclIor14CuWzA8xBXdiYQktKzNvuGKw9YykTk/Rj kYwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:in-reply-to:date :dkim-signature; bh=evqEKyKRq93CW7bOGoBWyVHoXocBvIcKIjPummzTEM4=; fh=+VHJirvZI9S/4X3+ldCzfEKJUxHLZ6HfF3FOqnPNx+o=; b=qiy1haTtPXJmWYboYajOSHiZt4imXTFyuDpYrS2nd4mA5P7TEwBduF8yJLV4hQQN7c a31YEHSSTe3z+V9oTCbkhiSKFBunE/wFktBRGKVCLkBVoMezM9D9L/6Bj9Hsc4PRgjSI KAWg+dNIbh3hxa1SIWQGmB081txD+oVCHW1E3HJa5ttBlXEBsE7LKyOUrQvg9brky31t 4kxSleYQNDcw768ZH4JNOxcR9n8tyAcd2HVDSjS681UvdIN1nVwmddNZVplYGAXSWywl wOmCyxK7+KjEimX0NwWSdgg6brc7n/3gZTfX4oPrkEY7/f3rYf2pYqAHfBWTGX9PznNu JgAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=EV57yJwD; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-172668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172668-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l19-20020a170906415300b00a599d71b456si4838393ejk.847.2024.05.07.20.53.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 20:53:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=EV57yJwD; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-172668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172668-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 402F11F24736 for ; Wed, 8 May 2024 03:53:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C90318AE0; Wed, 8 May 2024 03:53:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EV57yJwD" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7930A17756 for ; Wed, 8 May 2024 03:53:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715140399; cv=none; b=fpf0EJrARcvg3VTbr50uXs7Az5Z3ia2LSZX+9udaIjDv6IMq5TJs12pJ8hUam4G0BdwTrxuSwCLGoTmbpLitDte3tpm2T7imOWaK2dIKOV6CxdSoRCAlTYpvcostXRZx2nrkvheyxGgX+B9pVfQuvUvG9I2V9xyq5sE3HE9+QlI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715140399; c=relaxed/simple; bh=1gjiKx8CEp6GLpjJeA3XOWVnAQEoANQb0FbmONXrbR0=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=sJOzPQxBawHNJqWMRzPuxlZ4DINnx20dOSw9f/HRVjCcLGkmWjkJbHdNEfeBPBy4o+UJ6LlxwLzkdg0G3oTmKrT8iC6srRL9Tn5e0p8XU4cGQTOnHxvjthUsz88GfvjomFrvlVNPrPktgQO40vt88oF/r2uIFxiI1DNP8F7bRw0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=EV57yJwD; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-61bed763956so80589987b3.3 for ; Tue, 07 May 2024 20:53:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715140398; x=1715745198; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=evqEKyKRq93CW7bOGoBWyVHoXocBvIcKIjPummzTEM4=; b=EV57yJwDSoR3biBtmfXMvv3nRCD6OLGkeKIYBrsECK7VOqUarkS8pdRGyfBa4H36x8 5+XABmOQh7dwRaISHOXyPIstAUcwh6xnScsObUsNGglUel+l3IJRMUN+bkO1ykHO7O20 HzgzFi0IKefZ26F0gy2PAIpARoiSrD2eEJb5w8DvfplWYQNVr80c6IwBhO5fG4eQfZjs g3pnEIUoOPk3V6Mzji8XvM+QQmEwM183xSUBIrbi7vh13qLxQX0KBF1Juk5nyJAUMzQP 2hsaRLyDrati/MvtiM6VxEhMEKwnKoze7Wsr+5poCHXPFw99L5xdsrNE6BByDLAMEWpV Kkiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715140398; x=1715745198; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=evqEKyKRq93CW7bOGoBWyVHoXocBvIcKIjPummzTEM4=; b=ixCX/imFjOJLbr9t7VVVL4WGhzg+QDcGi+bZyo3jhYIs93gFZl3eF359z5MbhQgTG3 znxk32wOPkhyuvQsHSM2OoXiDtABTTWRNdgCwLorzsr/vWA8sT5CVRsrgrPT2bU1CRGn TTBMmN7r6tq97Gzd/ivvnHHd1P2WBdyUIKttxkMYsDeQplYgoQ1jucXdSTdvvLMnfGxR uvOUdtguMrM7H95W5d9lhKVNuyeJX5p0Bt1FZKUSu9rBGkuL+r80irTIjaRwse868GfY dRFrMdBG/HtvIhc3zb6J1wOyKo3Y6WMXCPmvvXZDZV6QuL/OlhlqvoPfsRQZ2sQPccdA m9eQ== X-Forwarded-Encrypted: i=1; AJvYcCU0YA6AFQvJ1hfCtj/rjAUGDMxFjwkQgIRHfICRlDdyY2ZYIf50Tj263noVFnnWjL9AQZwKTmLKnatLd7w+7E94Q6JTtin3OO3qVGqQ X-Gm-Message-State: AOJu0YznMiuEcjE8+2XQShRW/sgW4ghsLCJokClPeWzkOJa8yxaQIMBW vVjX5Hl2seFoFBJ2gI2bBfxQSGnHbRWUfxtyXsAAIv92BGDp780Rz6vfRd26UuuUjh6jpQUjEKU s5s+xBA== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:56f9:40dc:113f:ba3]) (user=irogers job=sendgmr) by 2002:a05:6902:1083:b0:de5:5225:c3a4 with SMTP id 3f1490d57ef6-debb9d3d713mr439844276.7.1715140397650; Tue, 07 May 2024 20:53:17 -0700 (PDT) Date: Tue, 7 May 2024 20:53:00 -0700 In-Reply-To: <20240508035301.1554434-1-irogers@google.com> Message-Id: <20240508035301.1554434-4-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240508035301.1554434-1-irogers@google.com> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog Subject: [PATCH v1 3/4] perf report: Avoid segv in report__setup_sample_type From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , Leo Yan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" In some cases evsel->name is lazily initialized in evsel__name. If not initialized passing NULL to strstr leads to a segv. Fixes: ccb17caecfbd ("perf report: Set PERF_SAMPLE_DATA_SRC bit for Arm SPE event") Signed-off-by: Ian Rogers --- tools/perf/builtin-report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 0892b6e3e5e7..69618fb0110b 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -429,7 +429,7 @@ static int report__setup_sample_type(struct report *rep) * compatibility, set the bit if it's an old perf data file. */ evlist__for_each_entry(session->evlist, evsel) { - if (strstr(evsel->name, "arm_spe") && + if (strstr(evsel__name(evsel), "arm_spe") && !(sample_type & PERF_SAMPLE_DATA_SRC)) { evsel->core.attr.sample_type |= PERF_SAMPLE_DATA_SRC; sample_type |= PERF_SAMPLE_DATA_SRC; -- 2.45.0.rc1.225.g2a3ae87e7f-goog