Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3453973rdb; Sun, 10 Dec 2023 06:26:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+ZS7y0s8WNMmY09MYJIIbq5QqDm0dyGIMwh6s0DI0n5z0/2da28Xl8pAovkxvtl+HDDMU X-Received: by 2002:a17:902:d509:b0:1d2:fa24:2266 with SMTP id b9-20020a170902d50900b001d2fa242266mr1223680plg.6.1702218395102; Sun, 10 Dec 2023 06:26:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702218395; cv=none; d=google.com; s=arc-20160816; b=rSwRdzWHoTFsM2FVSrsj42lkB9h89a2SI0hciWxuNcLRWm/FC4SgjPDCrRyz2zBhde clfQdjYJLtizQXZRXx/7cELPQx+VDAqRI8K2TeWOmaHHX5qul7Jdqub91SnsF91RdVFv 07+NVVJQpAIUd1CLy+lFpNpsOCVSGH3jxfTKkjE7TxJGZhhp3JUve64Gn62+X0ut4iIo 9sAQYejpmLODZnRn+fLRMhNXcGtrFlZzNvHkf6aLzgl6tGxjUGWfzc/JCkSe/314eUGj mKRo6I0Bh+r6uuKsyBjYq+TKgxEpgySwUpR/0NUxHFhybjlUO9XRI05mRK596ueduTxN yurA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=IGrwQmdzixBSjTEgYMbEjz4NlSHs2vWvEgsemI5eIDU=; fh=G/83VMsBzPXtrXGuk7n0vXkofgvgkBoDltxOyxsJJzo=; b=MpeJ7m3MkE1B1vspMHZCju4QeEYqMmKvfchxOnIOxqP1HffGbN1RKqwDgy4R35pul8 ZWnKV2ef6lN8nZ7f/JPC8xtdv7GUia+YrPSWUELIudkvGV7//GHXsl0rJInESeNko22M jgIz/nxvNQGbRr8rBG+P8D1Zn68R+AwGTPpB1+A/0lWkPZ5q6HG5a7WxTScVfGApI4Le 5rSrH7D/Hr7eL8qA1Re8OaE+GXhiUo3fRDuR/o6P8hAcq/lK5+lg2Y0C3WOXGOibD84D dpnmVDyntx8QcNrVD71jo1hRcfY1TDXeUT5frZrjcQBbfgWi0L5GLAX9YXWvjvot7ta3 +Faw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=P73w9OEd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id l13-20020a17090a660d00b00286d88927fesi5994298pjj.158.2023.12.10.06.26.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 06:26:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=P73w9OEd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 3DF94806D806; Sun, 10 Dec 2023 06:26:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232573AbjLJO0K (ORCPT + 99 others); Sun, 10 Dec 2023 09:26:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbjLJO0J (ORCPT ); Sun, 10 Dec 2023 09:26:09 -0500 Received: from smtpout.efficios.com (unknown [IPv6:2607:5300:203:b2ee::31e5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 485A0C2; Sun, 10 Dec 2023 06:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1702218374; bh=WfOzir+oTf44dYxvkiIaqqI0cQqL7L27KViNh2TxyJg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=P73w9OEdofIgWwoJOf+aGtqyasboZtm4H22KuOFqIxcVDEjFLFo+WEYCqP3PG7hFL TpFPDKBbWvs2KNmsnUrO8ZoySvKipzM7vM/uI6/FHdTB34H90C7CO42qADbpec61qG 5tAqaFKGh8aJFp5bFRCcsUUS0pKUOZLTlzmF5qlkwMHCOoKL/cvLNUz1wxrBRjLlSz LEO4p9YXoyiRjyPj/A2Kr7ta0fWLVzXMjc92VtElsOAGhVMts7oBGbOHIWk9HVsZid Nn7S5k7QOQ28IknFY4fB1k0yvFHicO3Wpc0XDNMb+6zVw8fGqyDC1JiQnmd2eyP1KD 3HJkBDv72HDyw== Received: from [IPV6:2606:6d00:100:4000:cacb:9855:de1f:ded2] (unknown [IPv6:2606:6d00:100:4000:cacb:9855:de1f:ded2]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4Sp6ck3NNyzG77; Sun, 10 Dec 2023 09:26:14 -0500 (EST) Message-ID: <3b45bdf6-234d-4859-8344-c18b48c8b415@efficios.com> Date: Sun, 10 Dec 2023 09:26:13 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 14/14] ringbuffer/selftest: Add basic selftest to test chaning subbuf order Content-Language: en-US To: Steven Rostedt , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Tzvetomir Stoyanov , Vincent Donnefort , Kent Overstreet References: <20231210035404.053677508@goodmis.org> <20231210040452.274868572@goodmis.org> From: Mathieu Desnoyers In-Reply-To: <20231210040452.274868572@goodmis.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sun, 10 Dec 2023 06:26:28 -0800 (PST) On 2023-12-09 22:54, Steven Rostedt wrote: [...] > +get_buffer_data_size() { > + sed -ne 's/^.*data.*size:\([0-9][0-9]*\).*/\1/p' events/header_page > +} > + > +a="1234567890" > + > +make_str() { > + cnt=$1 > + s="" > + while [ $cnt -gt 10 ]; do > + s="${s}${a}" > + cnt=$((cnt-10)) > + done > + while [ $cnt -gt 0 ]; do > + s="${s}X" > + cnt=$((cnt-1)) > + done > + echo -n $s > +} > + > +test_buffer() { > + > + size=`get_buffer_data_size` > + > + str=`make_str $size` > + > + echo $str > trace_marker > + > + grep -q $a trace This test has no clue if the record was truncated or not. It basically repeats the string "1234567890" until it fills the subbuffer size and pads with XXXX as needed as trace marker payload, but the grep looks for the "1234567890" pattern only. The test should be extended to validate whether the trace marker payload was truncated or not, otherwise it is of limited value. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com