Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4171070pxv; Mon, 19 Jul 2021 19:11:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmMhtO2oXMx5SIBfqr/O63G1fJ/KSG9xAEAKooigSlJP2B/T3Uqp7ZQzI+V8xOtsHHfncM X-Received: by 2002:a92:2911:: with SMTP id l17mr18797661ilg.263.1626747110808; Mon, 19 Jul 2021 19:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626747110; cv=none; d=google.com; s=arc-20160816; b=0LhEuT/TAdoCTmUIuBw22086o3AQT4sPVeDaiJ7WIFMopdP/T1lUAasL1mrVixA6rs i6d8mV+VrITAmw55cESGNNhF0C5U/4+Q4bDleMCxgz+7oS5Xaj/3/z7e/sr8uq1+RyfN 8ikywchn3dMzH+WmSYixSiVTk5y1ZkWGxkwxUxW9Saufs/gXMeJ251cXmD3+BaPTdsTB mN+05KeaRLqbXTuNSTs0otWGvU1Gfmt5Cys+oTktLCVEqPv3lyaBGshK4oGC0bLtG2Az ttJcrZQq0lWEnJoqtr/v2y/qFJ67uCWsUdOsq2X4dFqwiJZvIJCoVCrof6V8d477kj6i ySfg== 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; bh=vveOdlwtGdMTSEufe5WknkVdfygHuS1LNhMQGCuKXT8=; b=ii4Bp7elnudrW4YJNB///3OpFR1XIhCnr8EHjSQyJl1L+cnhYZx9QVI5HKCx8K7q2j dfXa0rnlVTqkpDDwfKGHrN0M3PHIPnpllILOMT3u4StbUYVDNBDdYOaXKnDkupRxCYnm s5qG4Oekij3i2DL1gwRk1iLkXiVoSuE1NAu/vYlF/8+VJe+NDCU5dI5f23VFs49amqvt +dbCOHptfu1oeUHkUQvOw2Wj9h1M9lohR53RkZeMrEChkZc6vPWRG74DRIXZf7f1/f69 f4430y5Ves1mDgIdLGnZQAx5MyHu1MXopSs2WL5oLjxkGzVdAMmQIZiWpY3wIBesPIce jXKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e127si22393997iof.13.2021.07.19.19.11.39; Mon, 19 Jul 2021 19:11:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245430AbhGTB3K (ORCPT + 99 others); Mon, 19 Jul 2021 21:29:10 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:7393 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239983AbhGTBYV (ORCPT ); Mon, 19 Jul 2021 21:24:21 -0400 Received: from dggeme751-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GTMQ46xMvz7wQd; Tue, 20 Jul 2021 10:01:16 +0800 (CST) Received: from huawei.com (10.67.174.96) by dggeme751-chm.china.huawei.com (10.3.19.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 20 Jul 2021 10:04:54 +0800 From: Zhang Jianhua To: , , , , , CC: , , Subject: [PATCH -next] trace doc: Fix the wrong example of tracepoint Date: Tue, 20 Jul 2021 10:06:07 +0800 Message-ID: <20210720020607.4128715-1-chris.zjh@huawei.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.174.96] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggeme751-chm.china.huawei.com (10.3.19.97) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The example in tracepoints.rst is out of date, the build error below will occur if coding according to example in the document. drivers/irqchip/irq-riscv-intc.c:24:24: error: macro "DEFINE_TRACE" requires 3 arguments, but only 1 given 24 | DEFINE_TRACE(test_event); | ^ In file included from include/trace/events/test.h:8, from drivers/irqchip/irq-riscv-intc.c:22: include/linux/tracepoint.h:368: note: macro "DEFINE_TRACE" defined here 368 | #define DEFINE_TRACE(name, proto, args) | drivers/irqchip/irq-riscv-intc.c:24:1: warning: data definition has no type or storage class 24 | DEFINE_TRACE(test_event); | ^~~~~~~~~~~~ drivers/irqchip/irq-riscv-intc.c:24:1: error: type defaults to ‘int’ in declaration of ‘DEFINE_TRACE’ [-Werror=implicit-int] There are two reasons for this error. On the one hand, the macro DEFINE_TRACE has been refactored in commit d25e37d89dd2 ("tracepoint: Optimize using static_call()") from DEFINE_TRACE(name) to DEFINE_TRACE(name, proto, args), and the doc is not updated in time. On the other hand, the tracepoint has been defined in header file, and it does not need to define repeatedly in C file. -------- Signed-off-by: Zhang Jianhua --- Documentation/trace/tracepoints.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/trace/tracepoints.rst b/Documentation/trace/tracepoints.rst index 0cb8d9ca3d60..fbb2cb4abd3d 100644 --- a/Documentation/trace/tracepoints.rst +++ b/Documentation/trace/tracepoints.rst @@ -66,7 +66,6 @@ In subsys/file.c (where the tracing statement must be added):: #include #define CREATE_TRACE_POINTS - DEFINE_TRACE(subsys_eventname); void somefct(void) { -- 2.31.0