From patchwork Tue Aug 22 18:52:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 136607 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp42765vqm; Tue, 22 Aug 2023 13:07:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFxjgTexDa+y8iMmmcqd7jjfj8+TOIeIaIfdKTCynKaVgy1Vhct9OJH1LirKMbQjt+ZJH+s X-Received: by 2002:a05:6808:238a:b0:3a7:2690:94e0 with SMTP id bp10-20020a056808238a00b003a7269094e0mr15934119oib.4.1692734824749; Tue, 22 Aug 2023 13:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692734824; cv=none; d=google.com; s=arc-20160816; b=mUDDCUn/i9d33xzmMt76bEd77FzscyTvlR2MG3P1n28kGfmZ/5+P+fPDL/Lc42SKIR 2ydvPsgDD/GRWd+nDJx7Q00Z99ZZVW+D1Af+VBZ9Jd4Gkc7/pC9DWnPVOZaxWmM0Dsbe 05yABpb3fuNQg6BJiQ3NO+g4u/9e4ccWQB+2lN4eyp7OQIRBm3HvinI81ltYtkW1T8T1 5KmaVbWQ0zghk0Fq9qGGhFdekPXTRrKL4RcdnT+K79mKQHY3jAAkryJZQR74ARCiPtcH tdMqUaJzhETRQkbSN4Qi0dcgcAuGiudoyKVc6auCyObCGWTABkT9Zrm9DcIURhkV4zrt Rv2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=iOs0qgbw3I9+YsQPEAA5mWWbtFU7eri1emTWoUUWj6M=; fh=9eWJ/J2CsGdvCor8FXbAWHiLj7G3R6ZrFCHUEnPqWEs=; b=YRLE0qJNdXLp4/h0KX/INwkZVQRCOdBqVUjfX/zgARdGrsWiPTDAjma/XcRAKJSZrW +j0eZo5rE46xmYKJ/Sqrs5Yqf7U7FhX3QG4P+aVOB6SnJuoJ0rpVLJ3rTANvHMyQk0Qa lcNBrCkEf1x0ZZvt5qlScLQvHFHl5oWuv5uqFu/JMJZor1o35v/7OL+tBUB++6Fqo8SE hJa41vDjAY3RdxPOZlerePLJLjGSqSdhZu7L4tspiPKJn7rIZzbrVGl8538fEsCRbO/j GZO6aNk6s2TzWk0F3r6rOds0WsEKSNP6/txk+x6Zuve31iqMP0pfNKRtaMqBY+fPvZAa PTyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dlZlpMsD; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ca20-20020a056a02069400b00564cd489aa7si903971pgb.552.2023.08.22.13.06.51; Tue, 22 Aug 2023 13:07:04 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=dlZlpMsD; 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 S229898AbjHVSwJ (ORCPT + 99 others); Tue, 22 Aug 2023 14:52:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229892AbjHVSwI (ORCPT ); Tue, 22 Aug 2023 14:52:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC73DCD5 for ; Tue, 22 Aug 2023 11:52:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8BBEC6579A for ; Tue, 22 Aug 2023 18:52:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5D8EC433C7; Tue, 22 Aug 2023 18:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692730325; bh=kYWtsRw4Oth+9kYIvyxl4uncgY/197vM3wf6YcmPdq8=; h=Date:From:To:Cc:Subject:From; b=dlZlpMsDidSgXWyYc9l0IpYrPwTwRYNZg7MerBpk1YNM8VLRckatM4WeXB2hHc04s MqSdxCFtRaib2Ra+s/MoD245KXjFuw57rHa9Z0VtBOONof9qPvsiQMyIPK45SrMsNQ CZgVfWfRDsEqeXMidr1u47buSutBrzGalEpzqhhJ2xxtuypM1oss5KQtmCzoZimceo FGC61uQ8U+60t8Jp0votAal5WT8MNSSo/oYkhPDljxzF8RihZgJzMWyZRoJS0lQHiD 9G20qPUz/HX5MuKfo2/G/48rM7AVyktj0j+E8h3igsC7Y1THCYqtEHmYCgrKgYNZIO /UGggXBphxkGw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 335F040722; Tue, 22 Aug 2023 15:52:03 -0300 (-03) Date: Tue, 22 Aug 2023 15:52:03 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Adrian Hunter , Ian Rogers , Namhyung Kim , Linux Kernel Mailing List Subject: [PATCH 1/1] perf lzma: Convert some pr_err() to pr_debug() as callers already use pr_debug() Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774961111370353783 X-GMAIL-MSGID: 1774961111370353783 I noticed some error with: # perf list ex_ret_brn lzma: fopen failed on /usr/lib/modules/5.15.14-100.fc34.x86_64/kernel/net/bluetooth/bnep/bnep.ko.xz: 'No such file or directory' lzma: fopen failed on /usr/lib/modules/5.16.16-200.fc35.x86_64/kernel/drivers/gpu/drm/drm_kms_helper.ko.xz: 'No such file or directory' lzma: fopen failed on /usr/lib/modules/5.18.16-200.fc36.x86_64/kernel/arch/x86/crypto/crct10dif-pclmul.ko.xz: 'No such file or directory' lzma: fopen failed on /usr/lib/modules/5.16.16-200.fc35.x86_64/kernel/drivers/i2c/busses/i2c-piix4.ko.xz: 'No such file or directory' Then using 'perf probe' + 'perf trace' to debug 'perf list', it seems its some inconsistency in the ~/.debug/ cache where broken build id symlinks that ends up making it try to uncompress some kernel modules using the lzma routines: 395.309 perf/3594447 probe_perf:lzma_decompress_to_file(__probe_ip: 6118448, input_string: "/usr/lib/modules/5.18.17-200.fc36.x86_64/kernel/drivers/nvme/host/nvme.ko.xz") lzma_decompress_to_file (/var/home/acme/bin/perf) filename__decompress (/var/home/acme/bin/perf) filename__read_build_id (/var/home/acme/bin/perf) filename__sprintf_build_id (inlined) build_id_cache__valid_id (inlined) build_id_cache__list_all (/var/home/acme/bin/perf) print_sdt_events (/var/home/acme/bin/perf) cmd_list (/var/home/acme/bin/perf) run_builtin (/var/home/acme/bin/perf) handle_internal_command (inlined) run_argv (inlined) main (/var/home/acme/bin/perf) __libc_start_call_main (/usr/lib64/libc.so.6) __libc_start_main@@GLIBC_2.34 (/usr/lib64/libc.so.6) _start (/var/home/acme/bin/perf) But callers of filename__decompress() already check its return and use pr_debug(), so be consistent and make functions it calls also use pr_debug(). Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/lzma.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/perf/util/lzma.c b/tools/perf/util/lzma.c index 51424cdc3b682c64..af9a97612f9df392 100644 --- a/tools/perf/util/lzma.c +++ b/tools/perf/util/lzma.c @@ -45,15 +45,13 @@ int lzma_decompress_to_file(const char *input, int output_fd) infile = fopen(input, "rb"); if (!infile) { - pr_err("lzma: fopen failed on %s: '%s'\n", - input, strerror(errno)); + pr_debug("lzma: fopen failed on %s: '%s'\n", input, strerror(errno)); return -1; } ret = lzma_stream_decoder(&strm, UINT64_MAX, LZMA_CONCATENATED); if (ret != LZMA_OK) { - pr_err("lzma: lzma_stream_decoder failed %s (%d)\n", - lzma_strerror(ret), ret); + pr_debug("lzma: lzma_stream_decoder failed %s (%d)\n", lzma_strerror(ret), ret); goto err_fclose; } @@ -68,7 +66,7 @@ int lzma_decompress_to_file(const char *input, int output_fd) strm.avail_in = fread(buf_in, 1, sizeof(buf_in), infile); if (ferror(infile)) { - pr_err("lzma: read error: %s\n", strerror(errno)); + pr_debug("lzma: read error: %s\n", strerror(errno)); goto err_lzma_end; } @@ -82,7 +80,7 @@ int lzma_decompress_to_file(const char *input, int output_fd) ssize_t write_size = sizeof(buf_out) - strm.avail_out; if (writen(output_fd, buf_out, write_size) != write_size) { - pr_err("lzma: write error: %s\n", strerror(errno)); + pr_debug("lzma: write error: %s\n", strerror(errno)); goto err_lzma_end; } @@ -94,7 +92,7 @@ int lzma_decompress_to_file(const char *input, int output_fd) if (ret == LZMA_STREAM_END) break; - pr_err("lzma: failed %s\n", lzma_strerror(ret)); + pr_debug("lzma: failed %s\n", lzma_strerror(ret)); goto err_lzma_end; } }