Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1576828rwb; Thu, 15 Dec 2022 11:50:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf7nhmZN0FH5S9z+1MWmWD+GZjz1A2TFWWkNhwrwATtWhSsiAvQagr9gHhT/5TgJ6D3YHVie X-Received: by 2002:a17:907:8d16:b0:7c1:5098:907a with SMTP id tc22-20020a1709078d1600b007c15098907amr23128160ejc.35.1671133831956; Thu, 15 Dec 2022 11:50:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671133831; cv=none; d=google.com; s=arc-20160816; b=FE7iurK9RGfoWHFE/bA3heGXK2NvzWZzT3Goc93dxryy2aDmQvmteuC2oSUcMd2oxR zGhoAgYC7BdyHOvA0xCMu9YT00J6xNfY/x4WTz+zCIyPB0MS/4tsqoTA0cnnIwuoixXY DZ20seWj4hW/RXQXD4tuL6zb2ZGxMhTvFXYoyQ0jyCGi7UEqbrDZUweZmnwem0RpPRqD CiW6CLEAE9Vdlb6tm4P2Wk8o7nvCQYg8SbosjvChDvo+yRTwvKFxz5BPnKus99tRIIGx thScb9ln/S6XTk0fVXO6+BDHKGjTlLoqgLnzanWHE9Kmo5jumMuTu5nh6TaWnwTdGQf+ BQrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=Tcnm4Zq93QUEsGpL/XwELq+tM+TYBnIw8vL4+pn2Juc=; b=O4hPogrlRfjt+rsWG7b/D54QkKUGcDiNlLHyEmWDZ9LyQhhhRc/fqPOQ6qpSdp5V83 YB7283x3ZnhuQ4z/HW3UGDuNXrWVf9utRqUQEnddwdgBXf5QBcwJi9ZzCC3O4jARrg67 wpoG4Z7PhQkyvCxzzYz6FUCMsjzqF9yAbbh51hr1kQSALfIcWVtc9mYp+fwSJNYQ+Zrz XxY8CETjGkne4nnOV0VVqRPPX4+mT//AoYCylJXymYWTjTBlGv0OIvf93q9JftZVWWU1 s4jZdu7M2kuIP+4fUoTn9OHZCKyF7gzborKeBg6EC+gFrX5SWKxhdWddCb3R5zLIqL9J gN8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=djhlXXsB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id tc10-20020a1709078d0a00b007c18d5fe285si13119ejc.713.2022.12.15.11.50.03; Thu, 15 Dec 2022 11:50:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=djhlXXsB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230060AbiLOT22 (ORCPT + 68 others); Thu, 15 Dec 2022 14:28:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229948AbiLOT2X (ORCPT ); Thu, 15 Dec 2022 14:28:23 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F59947310; Thu, 15 Dec 2022 11:28:22 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id l10so7893plb.8; Thu, 15 Dec 2022 11:28:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Tcnm4Zq93QUEsGpL/XwELq+tM+TYBnIw8vL4+pn2Juc=; b=djhlXXsB0/6QWxwYZIivL1rWWU3Jgt1lnyFA1luTJfnAArtoWBQXRYf1klMZtruE3f 3ZClMW21ekZecQNwH+Y6NcYFgh9TI92hIAqpZNrpg429K0Au152qTR1MQdAlvyn+BLUz 79G4lwNmD66L36k76vbaXmpBebWzkEmCqe3LV57J2F92T7li+nnUpDbzAN9TxmimL14t sv48p2QjfyiOcmK/4hJLULCuDMkWusZeq7xINUt9cb171D6nRZazmcCbupZRx2jrJvfN d9NNtNXPNOhSJYysvE4q7A6A8yGkD9Fa/vm6ZskShaknok0qcMQbyH6RvT3uva532tfF MBrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Tcnm4Zq93QUEsGpL/XwELq+tM+TYBnIw8vL4+pn2Juc=; b=4mzEQnl28/zDW5iMfJKkE250aSISMZxzNV7WAxhaIni0ZQSilhbG+1+T1U9swtOcrf 2odoBT60/4TS1X1gaojLY8jr6TaRZIxyYbJ6yydnqGP12teJPpfZHtOGAVDsoQrMNTB2 Rlu4vV3yKXrWhXENkIOlCQqL0YN3VmKQL3OFajViDk77J0qn2Q1EwcYJWqv3uGsi2fmr X59uK3wpcbKEwdV1sIvLp3HGAAwn6CVrIwG/DQM5eol8ZfL2baDPpKTqmQZwEI0en8hA aB9tIoQeN04BTKIan7wTpn3gBDrIJEBLHryc/8fpIa4Yygv2GxEgUlTmcbgomPne3tFZ cM5Q== X-Gm-Message-State: ANoB5pnMRPew/PajQDzMs1/Z4b80juKOfYHznWOJJAaytlCUrdj3FWna FheUo2ISUAaMeOFUKDf9Z/I= X-Received: by 2002:a17:90a:fe0a:b0:219:8cba:cbbd with SMTP id ck10-20020a17090afe0a00b002198cbacbbdmr30647158pjb.32.1671132501846; Thu, 15 Dec 2022 11:28:21 -0800 (PST) Received: from youngsil.svl.corp.google.com ([2620:15c:2d4:203:ecc1:3e44:be34:129c]) by smtp.gmail.com with ESMTPSA id ep14-20020a17090ae64e00b00219cf5c3829sm3475129pjb.57.2022.12.15.11.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 11:28:21 -0800 (PST) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, Andi Kleen , Milian Wolff , Leo Yan Subject: [PATCH 1/9] perf srcline: Do not return NULL for srcline Date: Thu, 15 Dec 2022 11:28:09 -0800 Message-Id: <20221215192817.2734573-2-namhyung@kernel.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20221215192817.2734573-1-namhyung@kernel.org> References: <20221215192817.2734573-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The code assumes non-NULL srcline value always, let's return the usual SRCLINE_UNKNOWN ("??:0") string instead. Signed-off-by: Namhyung Kim --- tools/perf/util/srcline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c index af468e3bb6fa..5319efb16a5a 100644 --- a/tools/perf/util/srcline.c +++ b/tools/perf/util/srcline.c @@ -716,7 +716,7 @@ char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym, if (!show_addr) return (show_sym && sym) ? - strndup(sym->name, sym->namelen) : NULL; + strndup(sym->name, sym->namelen) : SRCLINE_UNKNOWN; if (sym) { if (asprintf(&srcline, "%s+%" PRIu64, show_sym ? sym->name : "", -- 2.39.0.314.g84b9a713c41-goog