Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp467159rdg; Thu, 12 Oct 2023 10:37:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTe3aU7aYhAFdYfGv7szlI8xPXJyZVjyG9aS5KJbIRTgG17uTnORz4+WmR7T4/rkTZbJw8 X-Received: by 2002:a17:90b:4b4a:b0:274:6ab0:67ba with SMTP id mi10-20020a17090b4b4a00b002746ab067bamr19289387pjb.48.1697132235994; Thu, 12 Oct 2023 10:37:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697132235; cv=none; d=google.com; s=arc-20160816; b=oIcVKpLZYZ8kq4Qf0fNBKveoreBZhB5VZTHZctgaNNo7XTZCkOnaQhFYUDpC9e4HyO tIMi0scPDkm8k1q+RfJx5oFtakA2yXnfOgpPdUw/uvcg+RMLf1qhvl+nD5cmDUvckmAh LM2NGlwPOcQnbhFdlhw98agpeY93wfGd5sOsrTQCXYaCgcExJQLWw9/bwSFSY2TC0HfG HBQ8U2E/IF8GgiFBcbyHIAlh04DaFd+jq+8ueLUoar6loPI95bThKVbrxFalt4nVqJXQ MW4uYtVXrEEP4CjC1pmnw3/YaHmQbSO89HXbmfzw8YmDJ1sJhKlqujzq+Zyb+9D3a7ef drmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=qTdmH5z+p7Zkf2qQFdXJ32yElulwu+UZ7f7BXBGIKeQ=; fh=p/QKgDxn5J4BwLgY/NHYi2jb8ZwiSPjWQadTKqfFTIc=; b=UQ4CA6AtDn60PGrO3DFhNxkpGYWNvH4Et2eLqIitUxffrj70atZ2gePYbgZ2Vm+mlg yLTFjYK7EC9BAIA1lbOlusrnw/UL12ywIFdJ1dtMBV9pnKz07dwCNxTI7UZtJlmGRxOO F5GG16Dw4VAKMWRjiTJFm4sCSrs2qMQfwrWvYttBMyK8tUXtBRVlev/WxDm3+an8K3V4 FnIyeRjO15dmD1lXn983UGGBnidpZXgz8SdHpR2IwepGgnOVwFPWYsiyhhV6OIWGwnSX fjDadHjYJ7dgUi8L6W2hHRaUvEeX+/owbhwbNrFNkhFSDDs2RWNVUQbSgSEU5Rhr7+CU q5Vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id i10-20020a17090adc0a00b00279866aa14csi2682083pjv.16.2023.10.12.10.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 10:37:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D31C5824928F; Thu, 12 Oct 2023 10:37:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344065AbjJLRhD convert rfc822-to-8bit (ORCPT + 99 others); Thu, 12 Oct 2023 13:37:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347449AbjJLRgt (ORCPT ); Thu, 12 Oct 2023 13:36:49 -0400 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB51FD6C; Thu, 12 Oct 2023 10:24:02 -0700 (PDT) Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-27cfb8442f9so881447a91.2; Thu, 12 Oct 2023 10:24:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697131442; x=1697736242; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CJnRK+79WNn0lGWIpav/hJW9jfda5+J6HE7W4OW4WDg=; b=pIni7pUJgajGYSQU9SwzMEYgHHHdN24f7FuW5z6iwT5Y3Qbq4DKAVLmKXDNkehhJfb o84qccj2pQfymB+6z1XrgKf8lXryt/dqJNBSvevXZ48TH0Zv0vSYqs4MC30fJRT7bvR7 kHfLxczs5QunRMwof5JIwzbPGEMHIdRC0gl9CzuomngS4iexxt334utspR42uH+tW8BX PcSI3GQXJGAi0UVY934GK/O4ESSlBx/t12kVElLFUlc3ANTWhFdl8ku0u9jORuZOFxg5 lOLWAi8R3Uxoz0BjZ180Di6I/1e4CH+zC+Q8NmZ5SCUQuRnoOL7qfpp0PXFRypiRBhZi lbxg== X-Gm-Message-State: AOJu0YzqW4RvugHeUHRKUhmnrSlogUhF3HRYg3or4SJpy28JPN8af9yh gOShiXHzCV0D+0UughpY6HQLLgl9qWudgfxnaAU= X-Received: by 2002:a17:90b:14a:b0:27c:facc:e3eb with SMTP id em10-20020a17090b014a00b0027cfacce3ebmr6883711pjb.31.1697131442112; Thu, 12 Oct 2023 10:24:02 -0700 (PDT) MIME-Version: 1.0 References: <20231009183920.200859-1-irogers@google.com> In-Reply-To: From: Namhyung Kim Date: Thu, 12 Oct 2023 10:23:51 -0700 Message-ID: Subject: Re: [PATCH v3 00/18] clang-tools support in tools To: Ian Rogers Cc: Nathan Chancellor , Nick Desaulniers , Tom Rix , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Yang Jihong , Huacai Chen , Ming Wang , Kan Liang , Ravi Bangoria , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 12 Oct 2023 10:37:13 -0700 (PDT) X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email On Mon, Oct 9, 2023 at 10:31 PM Namhyung Kim wrote: > > Hi Ian, > > On Mon, Oct 9, 2023 at 11:39 AM Ian Rogers wrote: > > > > Allow the clang-tools scripts to work with builds in tools such as > > tools/perf and tools/lib/perf. An example use looks like: > > > > ``` > > $ cd tools/perf > > $ make CC=clang CXX=clang++ > > $ ../../scripts/clang-tools/gen_compile_commands.py > > $ ../../scripts/clang-tools/run-clang-tools.py clang-tidy compile_commands.json -checks=-*,readability-named-parameter > > Skipping non-C file: 'tools/perf/bench/mem-memcpy-x86-64-asm.S' > > Skipping non-C file: 'tools/perf/bench/mem-memset-x86-64-asm.S' > > Skipping non-C file: 'tools/perf/arch/x86/tests/regs_load.S' > > 8 warnings generated. > > Suppressed 8 warnings (8 in non-user code). > > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > > 2 warnings generated. > > 4 warnings generated. > > Suppressed 4 warnings (4 in non-user code). > > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > > 2 warnings generated. > > 4 warnings generated. > > Suppressed 4 warnings (4 in non-user code). > > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > > 3 warnings generated. > > tools/perf/util/parse-events-flex.c:546:27: warning: all parameters should be named in a function [readability-named-parameter] > > void *yyalloc ( yy_size_t , yyscan_t yyscanner ); > > ^ > > /*size*/ > > ... > > ``` > > > > Fix a number of the more serious low-hanging issues in perf found by > > clang-tidy. > > > > This support isn't complete, in particular it doesn't support output > > directories properly and so fails for tools/lib/bpf, tools/bpf/bpftool > > and if an output directory is used. > > > > v3. Add Nick Desaulniers reviewed-by to patch 3. For Namhyung, drop > > "perf hisi-ptt: Fix potential memory leak", split lock change out > > of "perf svghelper: Avoid memory leak" and address comments in > > "perf header: Fix various error path memory leaks". > > v2: Address comments by Nick Desaulniers in patch 3, and add their > > Reviewed-by to patches 1 and 2. > > > > Ian Rogers (18): > > gen_compile_commands: Allow the line prefix to still be cmd_ > > gen_compile_commands: Sort output compile commands by file name > > run-clang-tools: Add pass through checks and header-filter arguments > > perf bench uprobe: Fix potential use of memory after free > > perf buildid-cache: Fix use of uninitialized value > > perf env: Remove unnecessary NULL tests > > perf jitdump: Avoid memory leak > > perf mem-events: Avoid uninitialized read > > perf dlfilter: Be defensive against potential NULL dereference > > perf hists browser: Reorder variables to reduce padding > > perf hists browser: Avoid potential NULL dereference > > perf svghelper: Avoid memory leak > > perf lock: Fix a memory leak on an error path > > perf parse-events: Fix unlikely memory leak when cloning terms > > tools api: Avoid potential double free > > perf trace-event-info: Avoid passing NULL value to closedir > > perf header: Fix various error path memory leaks > > perf bpf_counter: Fix a few memory leaks > > I agree with your comment on v2 that it needs more work > to clean the code up. Anyway I'm ok with v3 now. > > For ther perf part (patch 4 to 18), > Acked-by: Namhyung Kim Applied to perf-tools-next, thanks!