From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753981AbcEXCQg (ORCPT ); Mon, 23 May 2016 22:16:36 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:34830 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753933AbcEXCQf (ORCPT ); Mon, 23 May 2016 22:16:35 -0400 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 165.244.98.150 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 10.177.227.17 X-Original-MAILFROM: namhyung@kernel.org Date: Tue, 24 May 2016 11:16:31 +0900 From: Namhyung Kim To: Steven Rostedt CC: LKML , Masami Hiramatsu , Shuah Khan , Subject: Re: [RFC][PATCH] ftracetest: Fix hist unsupported result in hist selftests Message-ID: <20160524021630.GA5062@sejong> References: <20160523151538.4ea9ce0c@gandalf.local.home> <20160523235438.GA1636@sejong> <20160523215045.583d0fc1@gandalf.local.home> MIME-Version: 1.0 In-Reply-To: <20160523215045.583d0fc1@gandalf.local.home> User-Agent: Mutt/1.6.1 (2016-04-27) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB07/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/05/24 11:16:31, Serialize by Router on LGEKRMHUB07/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/05/24 11:16:31, Serialize complete at 2016/05/24 11:16:31 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 23, 2016 at 09:50:45PM -0400, Steven Rostedt wrote: > On Tue, 24 May 2016 08:54:38 +0900 > Namhyung Kim wrote: > > > Hi Steve, > > > > On Mon, May 23, 2016 at 03:15:38PM -0400, Steven Rostedt wrote: > > > > > > [ Folks, is this a proper work around? ] > > > > > > When histograms are not configured in the kernel, the ftracetest histogram > > > selftests should return "unsupported" and not "Failed". To detect this, the > > > test scripts have: > > > > > > FEATURE=`grep hist events/sched/sched_process_fork/trigger` > > > if [ -z "$FEATURE" ]; then > > > echo "hist trigger is not supported" > > > exit_unsupported > > > fi > > > > > > The problem is that '-e' is in effect and any error will cause the program > > > to terminate. The grep for 'hist' fails, because it is not compiled it (thus > > > unsupported), but because grep has an error code for failing to find the > > > string, it causes the program to terminate, and is marked as a failed test. > > > > We have a feature check before doing grep, doesn't it detect such > > case? > > > > if [ ! -f events/sched/sched_process_fork/trigger ]; then > > echo "event trigger is not supported" > > exit_unsupported > > fi > > > > Triggers exist, but the "hist" trigger does not, and that's what is > being checked. Why not checking "hist" file then? Thanks, Namhyung