From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3B391F8190 for ; Thu, 14 Nov 2024 10:09:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731578954; cv=none; b=Kfp3DPp0lE4f+mkPVgvBbnNbO3oczDEtUQkwDB7srkvobIfY1Q06XaDMfC9Wl/rhrFAnvggYo5eFp20Bg+6ihjuqSr7PZbquPztg3/Gm3MOtbKf0fLhSYK2hfzuACc2nj7qEv+59gmHFAXmrbe48BovxHGZgvMroJgBFsUCCyLE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731578954; c=relaxed/simple; bh=RCtw/41LnewP0z/evO4ruTd9tgRyOr228p3t7dHkRR4=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=QIh3OL4lRqY3+HTB0Kn5IgMVM9EG3IppEtnUhwGA1BsOmT87e1PqO9ZbknfGX1ncvZuZn7pCGAl1/v0soDBB9htFI0fX++DoWqNOPVMHcSC8ksQhpvQiEf1G3vXPjiXItfHmAB3CBQq9xpGkzpZ/hMzCKu6KOVAOYSWDwzIEly8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=aZNHrFlA; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aZNHrFlA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731578952; h=from:from:reply-to:subject:subject: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=dYGCgLagMjZTMswLBxrAVu/PHrXp21KJtUV66BQOBLo=; b=aZNHrFlAZZm9i5kfZFF7g/XJjLbJZaxFJ2+NaUVnWynmawK0l2cMlVn67R2qqUEgcCsDdb L/WLOSSOtd+t86PsULXBXDUuBWUlbDAmhtn0qfdLRO62VwOEsErH0Fgw6KFNWQg8pXpKei +OxnPEkZcnDJ5vkFzzJuIw1JVqDwRkA= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-393-UfQoZvrRNNWA7HrjDoeDZw-1; Thu, 14 Nov 2024 05:09:06 -0500 X-MC-Unique: UfQoZvrRNNWA7HrjDoeDZw-1 X-Mimecast-MFC-AGG-ID: UfQoZvrRNNWA7HrjDoeDZw Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A362019560B0; Thu, 14 Nov 2024 10:09:04 +0000 (UTC) Received: from Carbon (unknown [10.39.208.40]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AB8A019560A3; Thu, 14 Nov 2024 10:08:59 +0000 (UTC) Date: Thu, 14 Nov 2024 11:08:56 +0100 (CET) From: Michael Petlan To: Athira Rajeev cc: acme@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com, irogers@google.com, namhyung@kernel.org, linux-perf-users@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, akanksha@linux.ibm.com, maddy@linux.ibm.com, kjain@linux.ibm.com, disgoel@linux.vnet.ibm.com, hbathini@linux.ibm.com, vmolnaro@redhat.com Subject: Re: [PATCH V2] tools/perf/tests/shell/base_probe: Enhance print_overall_results to print summary information In-Reply-To: <20241104072914.15196-1-atrajeev@linux.vnet.ibm.com> Message-ID: References: <20241104072914.15196-1-atrajeev@linux.vnet.ibm.com> Precedence: bulk X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On Mon, 4 Nov 2024, Athira Rajeev wrote: > Currently print_overall_results prints the number of > fails in the summary, example from base_probe tests in > testsuite_probe: > > ## [ FAIL ] ## perf_probe :: test_invalid_options SUMMARY :: > 11 failures found > > test_invalid_options contains multiple tests and out > of that 11 failed. Sometimes it could happen that it > is due to missing dependency in the build or environment > dependency. > > Example, perf probe -L requires DWARF enabled. otherwise > it fails as below: > ./perf probe -L > Error: switch `L' is not available because NO_DWARF=1 > > "-L" is tested as one of the option in : > for opt in '-a' '-d' '-L' '-V'; do > <> > print_results $PERF_EXIT_CODE $CHECK_EXIT_CODE "missing argument > for $opt" > > Here -a and -d doesn't require DWARF. Similarly there > are few other tests requiring DWARF. To hint the user that > missing dwarf could be one issue, update print_overall_results > to print a comment string along with summary hinting the possible > cause. Update test_invalid_options.sh and test_line_semantics.sh > to pass the info about dwarf requirement since these tests > failed when perf is built without DWARF. Use the check for > presence of dwarf with "perf check feature" and append the > hint message based on the result. > > With the change: > ## [ FAIL ] ## perf_probe :: test_invalid_options SUMMARY :: > 11 failures found :: Some of the tests need DWARF to run > > Signed-off-by: Athira Rajeev > --- > Changelog: > v1 -> v2: > Check presence of dwarf using "perf check feature". Add > failure hint message for dwarf based on this check > > tools/perf/tests/shell/base_probe/test_invalid_options.sh | 5 ++++- > tools/perf/tests/shell/base_probe/test_line_semantics.sh | 5 ++++- > tools/perf/tests/shell/common/init.sh | 3 ++- > 3 files changed, 10 insertions(+), 3 deletions(-) > > diff --git a/tools/perf/tests/shell/base_probe/test_invalid_options.sh b/tools/perf/tests/shell/base_probe/test_invalid_options.sh > index 1fedfd8b0d0d..c51d8d9bfdb7 100755 > --- a/tools/perf/tests/shell/base_probe/test_invalid_options.sh > +++ b/tools/perf/tests/shell/base_probe/test_invalid_options.sh > @@ -22,6 +22,9 @@ if ! check_kprobes_available; then > exit 0 > fi > > +# Check for presence of dwarf > +$CMD_PERF check feature -q dwarf > +[ $? -ne 0 ] && HINT_FAIL="Some of the tests need DWARF to run" > > ### missing argument > > @@ -75,5 +78,5 @@ done > > > # print overall results > -print_overall_results "$TEST_RESULT" > +print_overall_results "$TEST_RESULT" $HINT_FAIL > exit $? > diff --git a/tools/perf/tests/shell/base_probe/test_line_semantics.sh b/tools/perf/tests/shell/base_probe/test_line_semantics.sh > index d8f4bde0f585..f5d3b6e8d0d6 100755 > --- a/tools/perf/tests/shell/base_probe/test_line_semantics.sh > +++ b/tools/perf/tests/shell/base_probe/test_line_semantics.sh > @@ -23,6 +23,9 @@ if ! check_kprobes_available; then > exit 0 > fi > > +# Check for presence of dwarf > +$CMD_PERF check feature -q dwarf > +[ $? -ne 0 ] && HINT_FAIL="Some of the tests need DWARF to run" > > ### acceptable --line descriptions > > @@ -51,5 +54,5 @@ done > > > # print overall results > -print_overall_results "$TEST_RESULT" > +print_overall_results "$TEST_RESULT" $HINT_FAIL > exit $? > diff --git a/tools/perf/tests/shell/common/init.sh b/tools/perf/tests/shell/common/init.sh > index 075f17623c8e..0862cbc1c6f7 100644 > --- a/tools/perf/tests/shell/common/init.sh > +++ b/tools/perf/tests/shell/common/init.sh > @@ -46,10 +46,11 @@ print_results() > print_overall_results() > { > RETVAL="$1"; shift > + TASK_COMMENT="$*" > if [ $RETVAL -eq 0 ]; then > _echo "$MALLPASS## [ PASS ] ##$MEND $TEST_NAME :: $THIS_TEST_NAME SUMMARY" > else > - _echo "$MALLFAIL## [ FAIL ] ##$MEND $TEST_NAME :: $THIS_TEST_NAME SUMMARY :: $RETVAL failures found" > + _echo "$MALLFAIL## [ FAIL ] ##$MEND $TEST_NAME :: $THIS_TEST_NAME SUMMARY :: $RETVAL failures found :: $TASK_COMMENT" > fi Just a little change, in case $TASK_COMMENT is empty, the :: will be trailing at the end. So maybe... print_overall_results() { RETVAL="$1"; shift + TASK_COMMENT="$*" + test -n "$TASK_COMMENT" && TASK_COMMENT=":: $TASK_COMMENT" if [ $RETVAL -eq 0 ]; then _echo "$MALLPASS## [ PASS ] ##$MEND $TEST_NAME :: $THIS_TEST_NAME SUMMARY" else - _echo "$MALLFAIL## [ FAIL ] ##$MEND $TEST_NAME :: $THIS_TEST_NAME SUMMARY :: $RETVAL failures found" + _echo "$MALLFAIL## [ FAIL ] ##$MEND $TEST_NAME :: $THIS_TEST_NAME SUMMARY :: $RETVAL failures found $TASK_COMMENT" fi Thanks. Michael > return $RETVAL > } > -- > 2.43.5 > >