From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6417DC83013 for ; Wed, 2 Jul 2025 10:32:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE9BF6B00BF; Wed, 2 Jul 2025 06:32:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C9A8A6B00CE; Wed, 2 Jul 2025 06:32:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B89506B00CF; Wed, 2 Jul 2025 06:32:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A2C946B00BF for ; Wed, 2 Jul 2025 06:32:06 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0EA735051D for ; Wed, 2 Jul 2025 10:32:06 +0000 (UTC) X-FDA: 83618959452.26.926FD55 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf12.hostedemail.com (Postfix) with ESMTP id 93F4A40017 for ; Wed, 2 Jul 2025 10:32:03 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=O9y6FtW8; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=i+1h7gak; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=kwfiznIg; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=0NRMIEZB; spf=pass (imf12.hostedemail.com: domain of pfalcato@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=pfalcato@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1751452323; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LnXRBLsITs2/067KqgtslZSnFKkZefWJfj8CgjTubGY=; b=ebSH06ZTGlion7esJYM3U6fWG8egMCWPQ/jHQWgISwpYv+N9cc2D7vnl6w0F3TsO/1kW3f lcyMaMAnT2/3jQUDWxmyZ2iocQKnmHdz7hRGitXlY6+33tnYs5GJEw9rAmA1F9XdORifo5 tk3sZEDr6rFwO+jgD6p2Jj67At6rKv4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=O9y6FtW8; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=i+1h7gak; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=kwfiznIg; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=0NRMIEZB; spf=pass (imf12.hostedemail.com: domain of pfalcato@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=pfalcato@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751452323; a=rsa-sha256; cv=none; b=Iu0fRLIanpMDsSd2zioIGLT55wOLYqsbcHUvaSr0dvoiIVqJLo7dsMHknNmjftRMoivb2A 2AUiqWn4wcgUQU9WtAijGyUCuRbIlee2MQTDQBl3cORDlkXyJGHvqaZNZ8Ht36fGVBJlPr GiMga/foZszqmUYfguKl+yz+lWD+Aps= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AEBDA1F387; Wed, 2 Jul 2025 10:32:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1751452322; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LnXRBLsITs2/067KqgtslZSnFKkZefWJfj8CgjTubGY=; b=O9y6FtW8nY1DHM1oy9AuNKd7KiY1zJ3YgStQc+uJrygC074cfBoI6B4qL0O1+ATqABOiky qSVjKbfUcKvb+L9vVVoJLik9ycJCPM/0Z7OuELSo3u/2eAOD6fEtjQcdvebC3cdMOLS1XI Z/WGFKVaLLgF6H/J9nt5d8IuhN7Pk2c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1751452322; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LnXRBLsITs2/067KqgtslZSnFKkZefWJfj8CgjTubGY=; b=i+1h7gakAR1yfW0ekTsa//qAVR3SKe07NEXnoJSE6SUsRjJXSLfpHd58QYwnCQnNQ6If7d 2bSn2umx06tSq7DQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1751452320; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LnXRBLsITs2/067KqgtslZSnFKkZefWJfj8CgjTubGY=; b=kwfiznIgXEFUyd2YM872BZnJYApyB7GJsjA+XheePxskSk4Y8mBunItjeVmpK3ad2sLj9F W3zUxxQr3f6uIMRVkYnIJIB/NSRyhdcN4sNeZRoa+zqV6OpImgMG2HPZnPbcYsAeU4pZr4 yATVD6+mh9Et6izsBHUUdZjRKrcSdSE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1751452320; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LnXRBLsITs2/067KqgtslZSnFKkZefWJfj8CgjTubGY=; b=0NRMIEZBXNOCupYDARVBLPGUD3EZE5wMOkc99AwMry8oypQXQmiM46t7eVzWwzQEb/OFr7 5W4YeFWo2bM7kQCA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5797013A24; Wed, 2 Jul 2025 10:32:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id mlEzEqAKZWiIcwAAD6G6ig (envelope-from ); Wed, 02 Jul 2025 10:32:00 +0000 Date: Wed, 2 Jul 2025 11:31:58 +0100 From: Pedro Falcato To: Bhaskar Chowdhury Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2] tools: mm: Added modern version of shell quote and a stanza Message-ID: References: <20250702072801.10216-1-unixbhaskar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250702072801.10216-1-unixbhaskar@gmail.com> X-Rspamd-Action: no action X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 93F4A40017 X-Stat-Signature: ukuw37paan75n6pbgys31squ91twqy5s X-HE-Tag: 1751452323-433457 X-HE-Meta: U2FsdGVkX18CCkzcXC4Es94bUm4nTsx3uojNwM/u5+D1QYo4SxsKM8oSNjzIE/7E0OdC5RXlpR0mOIV4NJOYf0ywDG1Wo8jlLt7rG+HmTULLJAGg9Rh24HSxmwe8mhGSvipo8uUBLf4WCh/XJ2k7bp3EHZJoB2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q40o3lvTDVGUofwQ9sqxSjzsXM8esOqxOnZrAa4ufQSsHMN/LmpgOSaLqOX4IZUkYqmbHJgoe6xopn/KqqifD4OVNHW3fCD63vttmFfSyD342oBgf9gVEZ1I47LRIyK9 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, Jul 02, 2025 at 12:19:18PM +0530, Bhaskar Chowdhury wrote: > Three things precisely: > > Replaced backquote with dollar-parentheses ...that is modern way of quoting in > shell script. Improved readability. > > Added a stranza of missing/required command for the operation,in this case > gnuplot and that too in shell path. > > And lastly,use "command -v" to search the command i.e gnuplot and the REASON > for that : > > The -v option tell show shell will invoke the command specified as its > options.Basically to avoid dependency on something outside of the shell.It is > also execute command found in the PATH. Essentially, ignoring other similar > name stuff curated somewhere else in the system. > I don't understand what the point of this is, since we're not looking for the executable, we're merely executing it. If command -v searches through PATH, it will have the exact same result as just doing 'gnuplot'. > Signed-off-by: Bhaskar Chowdhury > --- > V2: What changes from V1: Verbose changelog, especially using command -v to > find the specific program i.e. gnuplot. > > tools/mm/slabinfo-gnuplot.sh | 44 ++++++++++++++++++++++++------------ > 1 file changed, 30 insertions(+), 14 deletions(-) > > diff --git a/tools/mm/slabinfo-gnuplot.sh b/tools/mm/slabinfo-gnuplot.sh > index 873a892147e5..6c9add4bb8ad 100644 > --- a/tools/mm/slabinfo-gnuplot.sh > +++ b/tools/mm/slabinfo-gnuplot.sh > @@ -46,6 +46,22 @@ check_file_exist() > fi > } > > +# This variable could have space separated value > +my_needed_commands="gnuplot" > + > +missing_counter=0 > +for needed_command in $my_needed_commands; do > + if ! hash "$needed_command" >/dev/null 2>&1; then > + printf "Command not found in PATH: %s\n" "$needed_command" >&2 > + ((missing_counter++)) > + fi > +done > + > +if ((missing_counter > 0)); then > + printf "Minimum %d commands are missing in PATH, aborting\n" "$missing_counter" >&2 > + exit 1 > +fi And this seems unneeded. The script is quite minimal and simple, and it's also named "gnuplot". Not sure what else you need there. > + > do_slabs_plotting() > { > local file=$1 > @@ -58,13 +74,13 @@ do_slabs_plotting() > > check_file_exist "$file" > > - out_file=`basename "$file"` > + out_file=$(basename "$file") But this sort of changes are probably welcome, though. -- Pedro