Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3877747rwb; Mon, 21 Nov 2022 00:13:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Q0KgBvm3RLK9piWthBy74KjdS0lcIBO9S/902ZvvItE8LSsYUrhF349y+AYOWOJZqQStS X-Received: by 2002:a17:902:748b:b0:186:8111:adff with SMTP id h11-20020a170902748b00b001868111adffmr10801941pll.81.1669018394695; Mon, 21 Nov 2022 00:13:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669018394; cv=none; d=google.com; s=arc-20160816; b=OTbl8MCzNQQG/Tk5/yGTDSMzO8xtCoxCrVCjPXZZsaDq16Fe3wV87qCaYFGPsVVsWv NLgnz9A23enAw0pdqCxBpYZSyhuH+bnlY2g2M3ntbhoU/VShOwyDdPyBYTZzPn14SIeI E5SvuCuheOhEA4jdLOI/O1pGn47VwuyKs7M1RnH2a0n+tFEpQXMbqPrjUwVXWL2sn4ZD DJejBILosxs5Jq60CquUTCB/IATTU5XMlf7jayl0IJQprxv1HABD8vH3kpNyrFmn5r3o /zHH4VSoqWuluETZ7Q/AGs2EfRRomcp4QixYX0lDJorvhyAqA54La7HKLO909HLp3gvL uo4A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=6WjVfFYLcTfewafnon3KVt0ktJTiMVy1KnjVKkT5rpE=; b=Wf3td6aXESi/sRklRWwsMxzc4Lz5kPHYba/2MSfqpQFsFdNwRh5fqRnsm/VLsqqn2O QhWudAtRyUTgwwUBnFaVcDrO7KZA5+uqfI7fgnpDUB9jEf9Ee+W9dLaLPyeDEHUjg4Qh x8Mqw3qQrGUNVulOS5m1xjfy+qRjyybnZxqOuWZLq7N6qvaNC/owiisooMHdSUbiKhrL r4CDKzndzEsX0Tpiw0OkuHm3igvS+0uEI5TwCWiibb0bHn2NLsybUCeBxWrOKFXgGezS krP0bLjdIFUtTuIPDCGCPbuGrX1xNkQNZ3kIE65n+BT1JSmT3VF92NLQH+e2Pi8Bngfp O/3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="b79/fyAq"; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a656687000000b0042b438eeee1si10840125pgw.148.2022.11.21.00.13.00; Mon, 21 Nov 2022 00:13:14 -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=@linaro.org header.s=google header.b="b79/fyAq"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229922AbiKUHwy (ORCPT + 91 others); Mon, 21 Nov 2022 02:52:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbiKUHwt (ORCPT ); Mon, 21 Nov 2022 02:52:49 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7DCFBC04 for ; Sun, 20 Nov 2022 23:52:46 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id y4so9885484plb.2 for ; Sun, 20 Nov 2022 23:52:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6WjVfFYLcTfewafnon3KVt0ktJTiMVy1KnjVKkT5rpE=; b=b79/fyAq/YHmS0tOjEAtCmJdzJ1Ua36rMCUO8ivApIafNLtN6kTGfwicRGJWxwKqJH lJqTjXKFQSETXnz1A4FO28qxJns3MyYYipxX7PqKjsNMbL6scsAern/+29y+tK3yRLiz Y3LRr9VjVmgT1PnZ6dOgikEtWkRy25Ry0OuR/0PI2mEoOSrjuzFBXMfg1jtCepGjgbqy UgvpV52e2CQo+J9euy+0nkAgV5wY/EDEiHyK4PfX08gIIZEqnh4jFb5OUx/HeIQ2hpfV EUnU/V/yKi6jiFZsTr6ubsWvFNhGJSlwWY2QQHqL7Vi0pVoCKYzysbYlKNYGskbqywlQ 3SLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6WjVfFYLcTfewafnon3KVt0ktJTiMVy1KnjVKkT5rpE=; b=YECZ+FyYBUN02HxUb5fyVH2gZcBvKI+MVQJwMs43+pTQcDW6c3swdUfl3nazIOdlhJ iiIb1ZgiauxGUNdTj+/K5f11AC0SQSWq6Qp17W+f4qjDlVJW/2K6wHbOERX7ML6Z0z9r UVvtclY66nr/jycYvPgX/BxNNZUVE+CSce94R9PE+cybV0sMhFu++WuwgDs7t1PipKLk lDo+ulo5guMM2xYmGKXLc5ZGju3tUL5GasEVLBtnpocX7LnYX+8H2bTABOWA7nvS79hL zJOjq4WaFESwLWDpSEAvTW7tQhj+OqEN+Dxf7qhIc+EC2y+zdSmCwy94Es+zqT9trd75 iKyg== X-Gm-Message-State: ANoB5pkAVaDbkb2tHn0jG6ryOQpe0XR1T7wpERecfqtFUdNCd3rT+Mfd fXAopWYiec9L6KABFS7l1/ae3Q== X-Received: by 2002:a17:902:ec8a:b0:188:640f:f400 with SMTP id x10-20020a170902ec8a00b00188640ff400mr1182661plg.143.1669017165937; Sun, 20 Nov 2022 23:52:45 -0800 (PST) Received: from leoy-huangpu.lan (211-75-219-204.hinet-ip.hinet.net. [211.75.219.204]) by smtp.gmail.com with ESMTPSA id h31-20020a63575f000000b0047696938911sm7006277pgm.74.2022.11.20.23.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Nov 2022 23:52:45 -0800 (PST) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , linux-perf-users@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 0/5] perf trace: Cleanup and remove unused bpf map Date: Mon, 21 Nov 2022 07:52:32 +0000 Message-Id: <20221121075237.127706-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 The initial purpose of this series is to cleanup the unused bpf map 'syscalls' in the eBPF program augmented_raw_syscalls and perf trace tool. The relality is perf trace tool initializes system call table based on map 'syscalls' and wrongly returns syscall pointer for non-existed system calls based on the previous initialization. So the patch set firstly addresses the issue for handling non-existed system calls, then it removes unused local variable and bpf map in augmented_raw_syscalls.c. Patch 01 is a minor refactoring to use macro to replace number, patch 02 is to return error if a system call doesn't exist, especially when we cannot find corresponding trace point in sysfs node, patch 03 is to fix the issue that trace__syscall_info() returns a syscall pointer even the system call doesn't exist, the corrected result is to always return NULL pointer for non-existed system call. The last two patches remove the unused local variable and bpf map 'syscalls'. This patch set has been tested with mainline kernel on Arm64 Ampere Altra platform. Leo Yan (5): perf trace: Use macro RAW_SYSCALL_ARGS_NUM to replace number perf trace: Return error if a system call doesn't exist perf trace: Handle failure when trace point folder is missed perf augmented_raw_syscalls: Remove unused variable 'syscall' perf trace: Remove unused bpf map 'syscalls' tools/perf/builtin-trace.c | 131 +++--------------- .../examples/bpf/augmented_raw_syscalls.c | 18 --- 2 files changed, 18 insertions(+), 131 deletions(-) -- 2.34.1