Message ID | 20221028180128.3311491-2-namhyung@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp971960wru; Fri, 28 Oct 2022 11:09:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7+0bUCxLr3GtfFPVJIHtM2QaUqDqJ2ss+5G8GRSnIzJN8w2yrBH2bZaGv5S0HiCQJiUHnn X-Received: by 2002:a05:6402:7c4:b0:462:9bc2:d0d0 with SMTP id u4-20020a05640207c400b004629bc2d0d0mr701594edy.122.1666980598122; Fri, 28 Oct 2022 11:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666980598; cv=none; d=google.com; s=arc-20160816; b=axyZiagY2QBq3uNaVw6e/rP0t+J+gKjpNF2BUnua1c5Ct8Uh8Bexcvrv1uO+D/iJwz IsBHeCX+SG3gwZ/vylqADtvUfsWvNzIjitNrSFODKbDOw79OwkwCoItIgDYID24Dl5O8 uf1uWwSSyw5/d/7yzpVlchgaUzzDDG4ZaqXdyKLktN3OjLOAivQCnRCJMKYEilOrtcdd pEwOAVAFcl2QaQ4gkYddafD+ttY8IAEmcogE6Nl9l1W2avThXOsTusPXg7DJSnPKR4Cw ZumOEYXk0+2+SCCYT2RJJqXXgVNRq5/tUjNklCDmHkoC12jL3e6mLtoyTDqFN9+9g276 Erxw== 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=NmGyjkUI3Jx6s05ye5A4TzB4tPD0VcBwkqsa8EyR1XQ=; b=MAJj8NYxi1M3puq82LluSgjuAchZpZE9yLnqyIimbHHwxr4HCdfFdbZQva5idQMYfl 9nHRJNfEcYSUv3w7APeNhV5IZtciMa+o8/jl53O60dRjlBqakTihpALiCW3MP1s4SvSd W1bAfNK65qQu3V1Z99x8MKuoLshSUNasu+NbiRhzjx0MWlkBsP3YEf8xBfB8/7TAeZNF a3tiUyk+6hT2cRWLkFCEZy8zfE5nD2W9yp2wjb7oiRRB+3yZ6o4KbLiQisORPRXKBFnu cdPnKajLT8DrgEXI2O4r1YY4ezO0jO7YbmuH9bJ2//kCshq2OyXLTqi48RsBXF4UEsnF eFuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hD6Z0lr0; 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 z23-20020a50cd17000000b0044ebf99d6f9si5620822edi.263.2022.10.28.11.09.33; Fri, 28 Oct 2022 11:09:58 -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=@gmail.com header.s=20210112 header.b=hD6Z0lr0; 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 S229636AbiJ1SBq (ORCPT <rfc822;norden.jeffspam@gmail.com> + 99 others); Fri, 28 Oct 2022 14:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbiJ1SBg (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 28 Oct 2022 14:01:36 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B918320FB19; Fri, 28 Oct 2022 11:01:34 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id f23so5485763plr.6; Fri, 28 Oct 2022 11:01:34 -0700 (PDT) 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=NmGyjkUI3Jx6s05ye5A4TzB4tPD0VcBwkqsa8EyR1XQ=; b=hD6Z0lr0qNzTb/h7xWEEo4kab7blvNR1dkhEaQcP+TQbguozLm/pd3/Wt/YmB4P7VN zVIhEM+5h48c3QkGE9zQvi9LVupqNaK2dYG+Fjcj3Pr7aL4ezJQvVeYbhMFgLxrVws4k +/U90S2XvRrJ/fjOz5Aj6jOZ/7czeOddZDXBXn/Si6nlOVhVnCIDgVibEdsBpWXxKKUu SSE/mFx6NJ3+KSrlM0jnpeBc9ltZsFAL+diDGr6YfNqElfMWiWPcZRC9WYXolLcGNZgW ppVj33Jp3cZ/d+WH9MrzS683eYX9A93CeqZWkFOY1saHh6BMkN5Marchffqlr3qop3zp IF5g== 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=NmGyjkUI3Jx6s05ye5A4TzB4tPD0VcBwkqsa8EyR1XQ=; b=NCkPKbE+jacPLisBJQAxuiH964muzLFrpXZGN0zp8pgn1cntnFw5bJS5pYROn5H+pn 9ssnONagho2m3f1NijusOS3W2mG924YxjW6NK0bmHC+2+VALwV8f5QWMfG5MBh6rMl1D 5qiN4WqhMxNMqFE10wUMNXjZC2IDY2o8C6m0FPBlOupGxTe4Saq8PSquGICsdcTAWaqz zZHkBeShxaLdxuI1ZZY/5D4mOpvb3PCO0s/HajvAYK2FqJdSu6Twkbbh6sUwHUhwm8LQ nE5KHbh8by1iLRGRLrxzhXaTc6c5lq6oO31baHhW01dTZ1/iOOHjWjV6WvtJRJATRTB9 iS2Q== X-Gm-Message-State: ACrzQf11HOA4z6M7N9ZNJ2i08yr4rh5R7NAr12ezDYcRBy/EWdxwcvpa Hr2b2XZKFWo4PM2cgP65IbI= X-Received: by 2002:a17:90b:4f4a:b0:20c:64e2:2bee with SMTP id pj10-20020a17090b4f4a00b0020c64e22beemr18093806pjb.32.1666980093820; Fri, 28 Oct 2022 11:01:33 -0700 (PDT) Received: from youngsil.svl.corp.google.com ([2620:15c:2d4:203:976f:f075:7c14:87a2]) by smtp.gmail.com with ESMTPSA id n3-20020a170903110300b00186b86ed450sm3400236plh.156.2022.10.28.11.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 11:01:32 -0700 (PDT) Sender: Namhyung Kim <namhyung@gmail.com> From: Namhyung Kim <namhyung@kernel.org> To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@kernel.org> Cc: Ingo Molnar <mingo@kernel.org>, Peter Zijlstra <peterz@infradead.org>, LKML <linux-kernel@vger.kernel.org>, Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, linux-perf-users@vger.kernel.org Subject: [PATCH 1/4] perf lock contention: Fix memory sanitizer issue Date: Fri, 28 Oct 2022 11:01:25 -0700 Message-Id: <20221028180128.3311491-2-namhyung@kernel.org> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221028180128.3311491-1-namhyung@kernel.org> References: <20221028180128.3311491-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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747955847338717101?= X-GMAIL-MSGID: =?utf-8?q?1747955847338717101?= |
Series |
perf lock contention: Small random fixes
|
|
Commit Message
Namhyung Kim
Oct. 28, 2022, 6:01 p.m. UTC
The msan reported a use-of-uninitialized-value warning for the struct
lock_contention_data in lock_contention_read(). While it'd be filled
by bpf_map_lookup_elem(), let's just initialize it to silence the
warning.
==12524==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x562b0f16b1cd in lock_contention_read util/bpf_lock_contention.c:139:7
#1 0x562b0ef65ec6 in __cmd_contention builtin-lock.c:1737:3
#2 0x562b0ef65ec6 in cmd_lock builtin-lock.c:1992:8
#3 0x562b0ee7f50b in run_builtin perf.c:322:11
#4 0x562b0ee7efc1 in handle_internal_command perf.c:376:8
#5 0x562b0ee7e1e9 in run_argv perf.c:420:2
#6 0x562b0ee7e1e9 in main perf.c:550:3
#7 0x7f065f10e632 in __libc_start_main (/usr/lib64/libc.so.6+0x61632)
#8 0x562b0edf2fa9 in _start (perf+0xfa9)
SUMMARY: MemorySanitizer: use-of-uninitialized-value (perf+0xe15160) in lock_contention_read
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/util/bpf_lock_contention.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/bpf_lock_contention.c b/tools/perf/util/bpf_lock_contention.c index fc4d613cb979..06466da792e4 100644 --- a/tools/perf/util/bpf_lock_contention.c +++ b/tools/perf/util/bpf_lock_contention.c @@ -110,7 +110,7 @@ int lock_contention_read(struct lock_contention *con) { int fd, stack; s32 prev_key, key; - struct lock_contention_data data; + struct lock_contention_data data = {}; struct lock_stat *st; struct machine *machine = con->machine; u64 stack_trace[con->max_stack];