Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp104778lqe; Fri, 5 Apr 2024 14:18:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVaZtp7x54EcmMllT1NwhCx7QFp6rP3ziqGsn9aKLtKhR8tr93sc6bZbOY+qPCsxwl73fgH80EklGW5YvdICKAmdRoCRjDtOtXgJu4JzA== X-Google-Smtp-Source: AGHT+IFzioescQnuEtJsH7u/a+X7vtqzBVHPuiJ80TJnPo7D4634EuGKL4xRuPqB7DiWg9ZK003F X-Received: by 2002:a05:6a20:3d85:b0:1a7:242a:5aaf with SMTP id s5-20020a056a203d8500b001a7242a5aafmr3911763pzi.15.1712351937578; Fri, 05 Apr 2024 14:18:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712351937; cv=pass; d=google.com; s=arc-20160816; b=rwZcCKAivMvI+OicNxl8mXRCEd3CTeZq8jyardkBybdIGm3lFQE9DQgi8dImk+VBVj VGF/081mpuRPbe8RFkuFX1dbxqKdpQzPyLNNTB3DFX9SOD4MBVK2adtmqbzmET9RZ8Ro iT7Hhggmq8FnVKn5lBeY2IhUtXT+E+T9/w0QlKwfJ86bs0O5uruWTchghxY6YGqha2KJ WPzMZ0hrKn23OChkA97E/qmo/KQ+WKw7J6tV9qJf+YtGi2uogUStRP2a3E4eNymx2CNN 5DN84iIx0PUOfcPGSHcLxQyjNme5RVPEZW2uHbrJeweD4doXUjrVqqDdyBTC/kjz3oz+ Po1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=q1Lp+Or3jLh/oqyEvWZz2Py3Nu/na1MuVBgMy1u3mFo=; fh=fHhbvXgCev/wpffLVpfaAi8pPyv7hrTyhVPgsZ7HNrs=; b=n9BykvEONuRDNF5uYUPLdh5gAaexSDkKLdv27v2xBKisVhrv3Hqu9Ap7mLb0W7v6oJ aMCwtPR6t+eItZv6U5KRl0c8E88yEPZ8Sk7oypfl7F6Y5QpSWiub9xTEFtTMVicNEVcp lSDAcn9hXd6Q90BlFHQXbcOEi1BvxZ14yJT8aSrjIru+m0MmtABvgv/nOPsLe28SyHYS tC17gq8hUS45tBU/8l9/WGpI9nLOhHsN68Q/gK2T2GV59WczloYIJv3/cZ39/N2hMSZc IuGHw1uS6WzXmG/xkUnnIPEMl41Ygbl/XOl8u0V2Y1B41UgW8xPuhDCReIuI0kH8LouZ RqEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iqL9R1aN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133588-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133588-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s187-20020a625ec4000000b006e2a6c63114si1990208pfb.98.2024.04.05.14.18.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 14:18:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133588-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iqL9R1aN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133588-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133588-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8B2B4B221C0 for ; Fri, 5 Apr 2024 21:18:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03A7B176FAB; Fri, 5 Apr 2024 21:18:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iqL9R1aN" 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 1D66F175560; Fri, 5 Apr 2024 21:18:04 +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=1712351884; cv=none; b=IIljUsd58MNODHMkhSZT8aaxemvo7H9jJmv0X1stNmHSAjfm9HR9WLHKxnjZCO4AkWKT3Yg3KlJMiFWGz0IJ2weEFiFD2Wg6Z9nslAhYUISJPa8m3Hp6fQyB520yIKvCHi8wfh67UrjxCw4We9CL5Zzd6TXAA1XELVWe1HtA8Ng= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712351884; c=relaxed/simple; bh=ItK41RqmUBjvIaYBvM/7weZYcst7IoTKTUZ5r9Uaq5E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F89K/WZrJ/77ZnLKu4K5cClkbwf4UArVfxvXBkpiOtLGG3C6NncJ5vlU8K66HRV1TA053lrzKLJCcMdlNUWDwEVRodecJiDTgdK/YQ0XQR0+tktv91qqfpa22CLfBz71txNyU9PSJb4dt8D7PdMvQAS7V3n8KDEwnLo0YcS8OGE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iqL9R1aN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A20D8C43330; Fri, 5 Apr 2024 21:18:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712351884; bh=ItK41RqmUBjvIaYBvM/7weZYcst7IoTKTUZ5r9Uaq5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iqL9R1aNx0z3z2Y0rkUr9j5gHKm0DsE1Vsw9uWJhqm6FZsRjllivep+e2PrSjvkTk U99AkUgd+gQPkxrg15+F2yA0DuFy0SQcmQp7byinTYntJSJkDew+z5e5W5nyZ9NjEZ v4zKsrjk79nRJO9tVwHRuqakLBO0BuUfmum5e//SeuT+HVG2mTfmPWVEc7I3s7o6qQ DoOVdLJF7Tk4gJE6c9f5x9fkeRiOXxFgI1sdwp4RJM2wl1uwabMnPbqMjMTgYMqGfo puNHp5XCV/eAeVkKAD/Wb5A3OOhobTDUkNltqEvfqi9wqq4alxxOW05PUZyRJwisRP FNl3hhW6LwhXg== 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 4/4] perf annotate: Get rid of symbol__ensure_annotate() Date: Fri, 5 Apr 2024 14:18:00 -0700 Message-ID: <20240405211800.1412920-5-namhyung@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240405211800.1412920-1-namhyung@kernel.org> References: <20240405211800.1412920-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: 8bit Now symbol__annotate() is reentrant and it doesn't need to remove non-instruction lines. Let's get rid of symbol__ensure_annotate() and call symbol__annotate() directly. Also we can use it to get the arch pointer instead of calling evsel__get_arch() directly. Signed-off-by: Namhyung Kim --- tools/perf/util/annotate.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 9df82e58cf6e..903565799d1b 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -2140,14 +2140,6 @@ int annotate_get_insn_location(struct arch *arch, struct disasm_line *dl, return 0; } -static void symbol__ensure_annotate(struct map_symbol *ms, struct evsel *evsel) -{ - struct annotation *notes = symbol__annotation(ms->sym); - - if (list_empty(¬es->src->source)) - symbol__annotate(ms, evsel, NULL); -} - static struct disasm_line *find_disasm_line(struct symbol *sym, u64 ip, bool allow_update) { @@ -2322,14 +2314,12 @@ struct annotated_data_type *hist_entry__get_data_type(struct hist_entry *he) return NULL; } - if (evsel__get_arch(evsel, &arch) < 0) { + /* Make sure it has the disasm of the function */ + if (symbol__annotate(ms, evsel, &arch) < 0) { ann_data_stat.no_insn++; return NULL; } - /* Make sure it runs objdump to get disasm of the function */ - symbol__ensure_annotate(ms, evsel); - /* * Get a disasm to extract the location from the insn. * This is too slow... -- 2.44.0.478.gd926399ef9-goog