From patchwork Sat Feb 10 23:50:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Bartosik?= X-Patchwork-Id: 199354 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1704885dyd; Sat, 10 Feb 2024 16:06:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXpbX02XKdOq+SEt/nrDR9ITTC6ft94tHsSTr3yvqmeISh/2i90CPJlURfGJ2s18Sryghw1adJnmReLKpbYX9N0wGb/Yg== X-Google-Smtp-Source: AGHT+IH8tgbVz4b+4njwr+rGDnhoIlXFanEVGDIfBP2cniulF+yuUcUm+vEwMi5kAdInawQ9JajL X-Received: by 2002:a17:906:1b10:b0:a37:5b1d:53d0 with SMTP id o16-20020a1709061b1000b00a375b1d53d0mr4147249ejg.31.1707609984475; Sat, 10 Feb 2024 16:06:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707609984; cv=pass; d=google.com; s=arc-20160816; b=eYirnOknhB2VbnYInTjo+Vf3TRHsYv1GdJkyTYuG+XAMTTLVqPNtVLusdQHa0zx9D3 0PGF5lwq8JYVn6UYK0XnxMx0KDwpbtSZp1javb1muwqvolph8jOmXDmCQuvhE38Gw4+Z zRxDbX/GRHgXzzKTwRQyRQgApOCqVKfI7gB1uFXnjGPA7DKAazu0a1QDdC3mBoAfDN1v oVcCRPNGAaQYTTKQtZZ+3wQUXu8MwwOCY0UByWvIJOg3hzlOTMzG3TNwLsu0YiYamCDx Uvw7Mpuv6wW+UIjjl9XTyQqEmZctvBJaToFDtnD6z9Hfe4xFeLfnAXqc99vpRZzH6S/f LC9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=5K6yqpYI+XlAR2tTr9L+vlvA6I/X8z92c+InJNhe9bo=; fh=FRYUSuFO5k02vujqv+0lrcq4z8UsqQiGZNs9/xGeUWc=; b=pQdK91lROECMOLFTX00sVbDMMPr0hsX8mhUoBAMCiJCgEEWBGsZo+1qRWJ26O2draY RT1iZgQZjNZwLjxXJwzQD7+pDJTqjWSWbtQg3lhNnEKGXO72keFOLHUtjC9/z9/+GnIj 26EJvMAjSOh/TE8/0AsIRxz67WCgtGbmQkYpJJgO95F2d6+5j4xr/3qziylqww4QEc5e xtHHCwkCiE5q5SmO1GCIE9QQNW68RtvVN2EK8ven+yI+QrYWxp8XLtLzB3Axu3xSYoRW TEhOQ7cc8NUAdf5YnDtxKagony0aZy05ZpeTFtHp+0dmHLdUpxuyw8kAY0yz0OClGlnn fnvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mVuHWRt4; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-60613-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60613-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org X-Forwarded-Encrypted: i=2; AJvYcCXqobVWVug8A86vVuKqvKlq1NvF4QXqqofKIxGtU/O3X7AstuC8mG6dpjuWZmUvRM8c7gDTxgKJsGfg6hOCZQTSfEpE/w== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m13-20020a17090607cd00b00a37a1e58242si2428974ejc.377.2024.02.10.16.06.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 16:06:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60613-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mVuHWRt4; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-60613-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60613-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DA7841F27780 for ; Sat, 10 Feb 2024 23:58:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC20564CEE; Sat, 10 Feb 2024 23:51:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="mVuHWRt4" Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4930F63503 for ; Sat, 10 Feb 2024 23:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707609083; cv=none; b=LaoQVlxPVZSKQAtQ3cqIkbnRVrVSsxQTDPOJ5PioFSywp/z0yyQGmZf7wdd9EVgKGcfHQ5h93VhFJZat6aQZYssaDqvctaJ8DXG5HKXhzIR98VQUZpQemy8byayIOy4dldVKgJaJ5iEhn1PbaUznk8P/QcLCZZW0ycGhoFfhMNI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707609083; c=relaxed/simple; bh=Eb0O+yG3cASWAUgAki6e+Q+mBl3FxWbfK/o4/1Bntgc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UXyZLBKGccIArOci96MkErmtjr+s/8O/5i0GQvbQv90+zdtJNHzAYcbFXaJKduUL5uRFefbcDIxTCMQS2JSEt4sPM/LNICS3E/6AdcJz1vBkbvTkFnbiPrtsUFG71drRO/MMGyEp0nIgmMla4Ijmz+L2TcBnINZdXOk35PFwQaM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=mVuHWRt4; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2d0cd9871b3so28962561fa.1 for ; Sat, 10 Feb 2024 15:51:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1707609079; x=1708213879; darn=vger.kernel.org; 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=5K6yqpYI+XlAR2tTr9L+vlvA6I/X8z92c+InJNhe9bo=; b=mVuHWRt46n8jwzYw2+fAqbeawf6r5rjeycnB+sT3UkEl1LqWBnbRTKqx6ZwIHPlCa4 eXI3E29Eoubmt+jJvwReZzQ06K0Odhgcy6oMzsdFsLl8GBdRvJ6P+FwKY135VITlu32B bdzm2sv1qNcXfAt584B2zlu3yOIol7tIEhII4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707609079; x=1708213879; 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=5K6yqpYI+XlAR2tTr9L+vlvA6I/X8z92c+InJNhe9bo=; b=AP3p64nO24LTW35D6A5eyY9+F4M0/ktIxukYPARwxk96zMw3JxfgurpfIo28ya3K2M 6oSmzQEFJNqF8T4ihB7mNd4asnIxRvr8HqkgtQ2cgxLCgotOJWiM1ZGXXI4WMCKAjBWH rorlcAKgjwCIj1uFWOmXEy/kePi/hBDov3zCpIsbcC7bL+9pcoEk/YRCMihYRWhwscXs yaX80OE7lF0IM4uNatkZNkVzs6xPqcGGe7R7aRHtJJyhF/RYGyqm+YMjXL4SblMOuotw kI0kqhahAIZdq64qU341OPfxF7ttXFnbDBNv6VXWZhS5zefcoBkfoqowBP/+6cZczmO6 iw1A== X-Forwarded-Encrypted: i=1; AJvYcCVfdnCQPVQr7gilOoFZ0UsGE2JSkBMtP93AksgOW5ubduutZtFaXhCnKZNwxox8pGGKVnrNiBFv0TKH6/tg99rLcOUG8sQPwhupocdT X-Gm-Message-State: AOJu0YwyZ2LEB/Hw+Taxl78T9aIR8zKUBp/ZH5/bC/o/GpfkcXNWszkK VH7Ur7t3PRZicAL++y4mqldg+KeaXQmNJnGoRlRAGTGfMSVYAj4+ReLQeO2s X-Received: by 2002:a05:6512:3ef:b0:511:7303:7ddd with SMTP id n15-20020a05651203ef00b0051173037dddmr907178lfq.22.1707609079610; Sat, 10 Feb 2024 15:51:19 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWGBVCu0vK0QqCmJjoomO3zmXV/S04S8NcctTEN+wop+TRxVlhvW1Ey+W/HOAnw7liXiw03xKb07g6385AUX0mMam/1kl8kbfTDkT2lskluOirb1cfgS6jf3vSliAsEnWzqZKfHByHsK9X+TS1NJL9WDcnaEZdHbBBiOpwYyK5xWvxMUiZGC6Eq8amkUSUdNBQDso2MDztT/6MZpd2Hwic8yaX6sRNHBBXpDkWstJda6fiIbtY9HRxSZYVA8sOQguUuF9iOFEdk45wgDga4J3J+gdHzXruGWtrcg7CQWfOox9MwV1L6pfFn0CTqL6T7CGzK3wQXjYZRBaB/h0bVgDqeH0MuK7cl6tI7dWriVWxDCg0wutOPaXpOIyZuUcLbDxqVbHcd8qEj0x6QJWSVVJaNvszjGet8cegWBbW5UigCnudydUtFet1A2MLJwbZUsQCUX/F+3ZPQzKQObnXEwxtO0Qcf5+50WHwSlPh/K9V6KrKo4TZPtnAVqOwgSex6/aH67U9BzyyXgKf/BNgX/Wroc83k35vKd7/IISPfHQZ6W5kv/g7bb9Irsfwvnj7AqEP5g51n6yElNd6BcSa/DtLgIgjiI+A55YmoogPaGaG3DspHnA== Received: from ukaszb-l.roam.corp.google.com (alfa56.extreme-net.one.pl. [213.77.89.56]) by smtp.gmail.com with ESMTPSA id o27-20020a056512051b00b0051179ae1846sm365561lfb.280.2024.02.10.15.51.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 15:51:19 -0800 (PST) From: =?utf-8?q?=C5=81ukasz_Bartosik?= To: Jason Baron , Jim Cromie , Greg Kroah-Hartman , Andrew Morton , Kees Cook , Douglas Anderson Cc: Guenter Roeck , Yaniv Tzoreff , Benson Leung , Steven Rostedt , Vincent Whitchurch , Pekka Paalanen , Sean Paul , Daniel Vetter , Simon Ser , John Ogness , Petr Mladek , Sergey Senozhatsky , linux-kernel@vger.kernel.org, upstream@semihalf.com Subject: [PATCH v4 30/39] dyndbg-test: fixup search-trace-name help Date: Sun, 11 Feb 2024 00:50:00 +0100 Message-ID: <20240210235009.2405808-31-ukaszb@chromium.org> X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog In-Reply-To: <20240210235009.2405808-1-ukaszb@chromium.org> References: <20240210235009.2405808-1-ukaszb@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790558846617842033 X-GMAIL-MSGID: 1790558846617842033 From: Jim Cromie The recent change to do whole-buf search (not just single line) had the side-effect of printing too much $output, which hides the information in clutter. Print the search pattern instead. Also add -v last arg handling, like in check_match_ct(). This lets a single caller enable verbose output, to see the trace-bufs content. Signed-off-by: Jim Cromie --- tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index a48cb57aa5cb..d1f447eef4c0 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -159,6 +159,7 @@ function search_trace() { # $1 - trace instance name, 0 for global event trace # $2 - line number counting from the bottom # $3 - text to search for +# $4 - optional -v to see verbose results function search_trace_name() { if [ "$1" = "0" ]; then buf=$(cat /sys/kernel/debug/tracing/trace) @@ -179,8 +180,9 @@ function search_trace_name() { in line '$line' or '$buf'" exit fi - if [ $v_search_trace = 1 ]; then - echo -e "${MAGENTA}: search_trace_name in $1 found: \n$output \nin:${BLUE} $buf ${NC}" + if [[ "$4" == "-v" || "$v_search_trace" = 1 ]]; then + echo -e "${MAGENTA}: search_trace_name in $1 found: \n${YELLOW}$3 \ + \nin:${BLUE} $buf ${NC}" fi }