Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3862326rwb; Sun, 20 Nov 2022 23:57:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf7551tJZ7r+eXQhnS3heP8yVSo4aK7zmgX+uYBLw4GbERQUtmSSqVeRkD/tj3Zam1FKsFdr X-Received: by 2002:a17:906:4e46:b0:7ae:129b:2d3a with SMTP id g6-20020a1709064e4600b007ae129b2d3amr14434216ejw.552.1669017444777; Sun, 20 Nov 2022 23:57:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669017444; cv=none; d=google.com; s=arc-20160816; b=wTw4yYe/Rz8ZsLEYbjG642JfIPSYNnwMz35XzTxm0DlN7hcO+K45pm1kOWYOMJZ3Dz VK9kUbbgTsHJHwYOyIWA5xZ71TMW5YCi2T2XyLQShetNImeILxmL5mZ4ss0tEcPh5U1z GyN+CkJ2QHJfkqTNgMZnAIVm/5+GHY8XeFU44OwJ04PisV683cwd4RecO7Zeq0m4yyAO TJkFyxMgr/G2OiFduVP7oiAV0xwVusrykxd8NnvF1rabREk1sEX4Vl/B2pah14r9/Xpv C8H276xHqzTXc6mpTFf6k2Fjz8AAetPMN8K5QbKWEIIKInBxrSzJQa+Dehm7/A+InarZ +TTw== 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 :dkim-signature; bh=Pvc1zXEGR7HMHrwAlmwh9iePoKt7remHUDBQE6tcKek=; b=xRgZQZmb2BO9A6oonNzQP34Vj0hTdxh9EHed9wno5hEQz8r6l0K+KT2rCJaEQWDxCu ZavU/MsxRP3/OrAKqAPfZQV8o63iSw8VL8BxKimo0lLY5Hihg78MyMj71nlPWxjwPJqu kYEZz8Qapdqoq2kFu6KbISw11CjSC3/5LJ+dpmC76gWFMBYUTq/TIsCvXFqBUUEIdaYS o+1aewSEXK6GzwPrbOt8lnQddWDnL4qCp46lTuf7TwdA/jhSaetyuP0C5VwTE7TDQhhp lMtCzSH1h5bTcd4scnVUvn68UBumWXtJPfdpmKnuCD8fPDKx6Lw7AlK1WY93gbef9Hli HgBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fuRSF+oq; 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 b19-20020a056402351300b004511d552be3si3727329edd.4.2022.11.20.23.57.02; Sun, 20 Nov 2022 23:57:24 -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=fuRSF+oq; 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 S229735AbiKUHxL (ORCPT + 91 others); Mon, 21 Nov 2022 02:53:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbiKUHw5 (ORCPT ); Mon, 21 Nov 2022 02:52:57 -0500 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FF741571B for ; Sun, 20 Nov 2022 23:52:54 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id y203so10618279pfb.4 for ; Sun, 20 Nov 2022 23:52:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Pvc1zXEGR7HMHrwAlmwh9iePoKt7remHUDBQE6tcKek=; b=fuRSF+oqTR6nicfjS6pFRenl0ln+tt5LxFA9pJwpIX9ZXcBuWJc1wmJU+1c8s8szwo Hu82FRt4aTLXN9hxyqyRQltl4dGqabZuZ1GFHZHk0vTbps5p8eP8bMrPzS9yKKLe+P+h /PWW2gHcTnRgislEbqElp38G+hdl8iN+Nqmmn/ZvRVzpHhklh5UeAqmT00xQwnBXFDik hqQhA0gpN7VDwK5EjADucMgGg5qaz9NAG9Vyyq41VkagnbG42V7jeaMPREtIbh/ssMm2 tVj1m0yXMBFJjxg56NKU/aPkshDlrpFep/WAbE5l+6I4D6A9FEFKmtKzQFzb7OXoO/K2 CgbQ== 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:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pvc1zXEGR7HMHrwAlmwh9iePoKt7remHUDBQE6tcKek=; b=wcTvAzxu4jUVSg32EkQcB96Xx5XIGOuNDAArGfMVV6DqaLtOVVHQrA1QnLZBs0brx1 w9uFFVUG4JY+QimhCiZ8YMW4v1ocEMTbxX7Y7M/fwkFs61Q7SS8+XpclJWWHE0B+63tc CWH5DjXg9VXXYB7NwBwNdoe5Jw1jth+Hh4zvRrfTd8i0S4AAiXp3FsD/QiF+U2n6ztar EjIatLqx15q6/I/l0hp/Uq4g84pu9BpsJ+uaYx6572vPuJBaxSRZTW87xvXgw7ArwTHo PFXD5aPYm/5XNO+sRF2ljcDigAMlD+LY0YzgmuF/R3teyaakRxvvAA1BncZFBqj0KEo1 GYhQ== X-Gm-Message-State: ANoB5plNzkYnEZxcU+xCVAmgisVtp1U2jWnBXpitLeve/ThNtCSp2KRl 0GoN3VBki98E3leRADfFB9dONQ== X-Received: by 2002:a62:542:0:b0:56c:45db:4481 with SMTP id 63-20020a620542000000b0056c45db4481mr18882213pff.86.1669017173582; Sun, 20 Nov 2022 23:52:53 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Nov 2022 23:52:53 -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 2/5] perf trace: Return error if a system call doesn't exist Date: Mon, 21 Nov 2022 07:52:34 +0000 Message-Id: <20221121075237.127706-3-leo.yan@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221121075237.127706-1-leo.yan@linaro.org> References: <20221121075237.127706-1-leo.yan@linaro.org> 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=unavailable 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 When a system call is not detected, the reason is either because the system call ID is out of scope or failure to find the corresponding path in the sysfs, trace__read_syscall_info() returns zero. Finally, without returning an error value it introduces confusion for the caller. This patch lets the function trace__read_syscall_info() to return -EEXIST when a system call doesn't exist. Fixes: b8b1033fcaa0 ("perf trace: Mark syscall ids that are not allocated to avoid unnecessary error messages") Signed-off-by: Leo Yan --- tools/perf/builtin-trace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 22008a31684b..bd5513b15cde 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -1796,11 +1796,11 @@ static int trace__read_syscall_info(struct trace *trace, int id) #endif sc = trace->syscalls.table + id; if (sc->nonexistent) - return 0; + return -EEXIST; if (name == NULL) { sc->nonexistent = true; - return 0; + return -EEXIST; } sc->name = name; -- 2.34.1