Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp892802pxb; Wed, 27 Oct 2021 14:36:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymkO7va0ni5pNw64DwT88In9n60P+Ui+ZLgbPs28rjvzYdaDIgqSff0b0Ga3rtSoEQLvWW X-Received: by 2002:a17:90a:4b85:: with SMTP id i5mr8641536pjh.25.1635370482581; Wed, 27 Oct 2021 14:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635370482; cv=none; d=google.com; s=arc-20160816; b=W5LIIwthDHIV9gTtMPihxo8W/MdgrTxMURszWT91mHPiKwOSYNwED91LUyjhNsPssX o+LvZEphw/zdNkwMlXSlIJ3XBvCtRM61YwmmUPUi7nDjzb9lz8OKzJoD6r6p2k/xp4sF AK2+Ry33dmcqz/m8tiX6ZfuIvLTK/3IHG3/eDPSpUZ0rvxOgQSVO0U3x3/qVo62QejCk 74cS2ptC+HtxHR4xsPI4M+AZmJEZ6jkeBZpQSvgO6EReoWDkbbfgHgYmnlFsNC/A0V6h MORgmiHkQctOGbSA4rHM64xm15+yTmlJvQrQtf9M/rnwDDk9JOWxccdOzj6UiSpJ7BJM p6rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:cc:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=HUT1jrky2QfADSJBqDyxkAfRQl5Gv0by2m5wgHaMIGI=; b=0NMCOXYHqkrIu7yKeLi2sTeOokhm9TvFKbHhwinMUYaHPjW+dlgtEvVL1WtcbYwZno BdeeQJlh5XVBNSCwBsTc3gWr80Hdw9pQ2l6o6xCQ+3L51RwhxMWGfZFnuDp4Jn84EbDT qxPOMRALTU3WScc1k1tOJ5Br1sSBXU9vWy/7vXuEI99AtOs8hqJyTB72CdT5zPG6gSP9 0UmTl1EwEO8e7rj9H7Q0AM7x4BP3mfhGEQjfzjetJmka2PC2M+gueKSXZ7GhzrbdpI8m 1np4GuQeUOs/SZBG2pACsEhHywCHqtijJLhL2vkLCz/dwU6gghSgkQCwg4fskcBTTn3B iWvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=mzwlor0I; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si1656179pfv.376.2021.10.27.14.34.30; Wed, 27 Oct 2021 14:34:42 -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; dkim=pass header.i=@google.com header.s=20210112 header.b=mzwlor0I; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236958AbhJ0VCk (ORCPT + 97 others); Wed, 27 Oct 2021 17:02:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244149AbhJ0VCj (ORCPT ); Wed, 27 Oct 2021 17:02:39 -0400 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53B61C061570 for ; Wed, 27 Oct 2021 14:00:13 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id n9-20020a63e049000000b002951886c1c5so2180269pgj.0 for ; Wed, 27 Oct 2021 14:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:cc; bh=HUT1jrky2QfADSJBqDyxkAfRQl5Gv0by2m5wgHaMIGI=; b=mzwlor0IxbDrHZ832vmIGDKIRLJHzHXUSJ+qdT2DtWDviVCexFW2Qe8impwSet4coq S4aBLll36JwfUZ0gqCf5lbUBGExW7TtD/lNHf6y0uehgpOWapnxLldAKOjCrcOePTkm/ mDL4xvBzxSu+0wFXm6YAi8zdjwMxqyhAQLYU35M4Be/Vmq0iVgdyPxtL6QT4WK/WoyBM fs1S5OL+TRwbXL5B71gULUE004KsnUgIC9LhxuM1/IYIu/iBAllYQcad9ifv0hbLwTSJ zqGvmhEGGDsWWeG1s+Wp2Slb9lC8V1rxGDo9GPrrnUuTJv6tA+Ts2ht8U7FSzyyTxwx3 g5IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:cc; bh=HUT1jrky2QfADSJBqDyxkAfRQl5Gv0by2m5wgHaMIGI=; b=5ZylzvZwFWbCZu77zxx9pR/C+z5+ZR56lSdb+ZhaqeskO/5rTDoo51SQnxMNSmFq1Q F66zytWspCK4iJCD7dLq6JUi4SGl7YuJjBWn1jjMvyg57mhzXjoVAKDUmNMz2Aaww3p9 c7THHme+w+MDvp7SUOkEhXe4d2y56+G8ajjFwlMhXbxnebpdQ51BJIYdnpULRB+XQ5F0 UWHII+nktPjtlS3r3SO0ETCLrwlVQbGt3Ie5u0EiAHzogDwe7JvQW4jnsdxl3Fy/c16N 1xpfyYUurJAm/RI1CV5AFbncxUhL+BZaBZPWH9cQnUFtvKdMgCRGuk8YuwPMIzfTqQLb qbag== X-Gm-Message-State: AOAM531ageYWAL4i9+i5Nmj5plybOVGLl3t9IbbflcMCsHC0XjzTapUj NzpusqvupLEVjmilNgkJQ1UTkYwtsapfkVXZhg== X-Received: from kaleshsingh.mtv.corp.google.com ([2620:15c:211:200:ac51:b6be:9b51:3a7c]) (user=kaleshsingh job=sendgmr) by 2002:a05:6a00:2387:b0:47c:134e:4848 with SMTP id f7-20020a056a00238700b0047c134e4848mr37555pfc.74.1635368412797; Wed, 27 Oct 2021 14:00:12 -0700 (PDT) Date: Wed, 27 Oct 2021 13:59:09 -0700 In-Reply-To: <20211027205919.1648553-1-kaleshsingh@google.com> Message-Id: <20211027205919.1648553-3-kaleshsingh@google.com> Mime-Version: 1.0 References: <20211027205919.1648553-1-kaleshsingh@google.com> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog Subject: [PATCH 2/3] tracing/kselftests: Remove triggers with references before their definitions From: Kalesh Singh Cc: surenb@google.com, hridya@google.com, namhyung@kernel.org, kernel-team@android.com, rostedt@goodmis.org, mhiramat@kernel.org, Kalesh Singh , Ingo Molnar , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If an event trigger references a variable defined in another trigger, it has to be removed before the trigger that defines the variable is removed. Signed-off-by: Kalesh Singh --- tools/testing/selftests/ftrace/test.d/functions | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions index 000fd05e84b1..bd9e85f4d626 100644 --- a/tools/testing/selftests/ftrace/test.d/functions +++ b/tools/testing/selftests/ftrace/test.d/functions @@ -22,6 +22,15 @@ reset_trigger_file() { file=`echo $line | cut -f1 -d:` echo "!$cmd" >> $file done + + # remove triggers with references next + grep -H '\$' $@ | + while read line; do + cmd=`echo $line | cut -f2- -d: | cut -f1 -d"["` + file=`echo $line | cut -f1 -d:` + echo "!$cmd" >> $file + done + grep -Hv ^# $@ | while read line; do cmd=`echo $line | cut -f2- -d: | cut -f1 -d"["` -- 2.33.0.1079.g6e70778dc9-goog