Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1498230pxk; Sun, 13 Sep 2020 05:07:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwat8RyXoCxQZpDJYFd8H4RpfXija2jABHLNScSpV/dmWOqO/ry96OozzJndUTFSN6le1+g X-Received: by 2002:aa7:d585:: with SMTP id r5mr12488351edq.278.1599998820943; Sun, 13 Sep 2020 05:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599998820; cv=none; d=google.com; s=arc-20160816; b=w+7YBvq0umZ+QTucgVodq4P39dtWkwom40LQyThGSI5Yyh252udeQB+RFDN5j8eNMM 9ATgpMEp8MCNbJFi21Mb0IiPIgTFyc3iOnXzm+qFB2CgnEKHxKS3EqqhZpF+eJKfDlWB qZ0mpt0rEHXDY3HtYHguW08RTpsHt3MzoRs0xAxfzOtPnRLwCUlFoGed1x12NpvhpGAW 6zOAKRX00TOeGVqZL33ydaNCWz9Z/X/PWXRrxD08ylplncdoAlfYDeAAFZNyrgChn7M+ 7fINzM4c4hD6fcNKRWvhkNIRg23LKnVzVMtxf2cPmOR4/8YdIglt8a8KRHbdkUfGZJ+L UveA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=Vsq2EpPAKnreG44my/rSP6OLukd3irJGMACNHFoXfQY=; b=vhCrJxMBXo840QSGBEPfhuDlFUoC86vMdS09Ra9cqQqPbvJubG2k+9P92kWxu1NouY y5KnoeoxE33XqYopVKWZPV41ecg9Hcurawh5QN/0G8HdsSElVwMZhX220AbOOk1+Ved3 QRm367s9htI/qezbPedDXsENvTPZXRx72e989CnDajZsF1z1l5Qtc/e+hNNSKwS0ohH7 ZqqGw6ehCppU9H9Wfczd7B/i2hoAI1gAUmOBWQ9azOPiLlJ0HEw8DBZCgrBwv4G3isVD CzEsRmCjPf3pYJpjsk/oIFFJMdZs5TQ2i2kYYlECi5ADJ88FKwRlc7O/KW23IBsFGxwx 2NNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HYmWTVRA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c24si5437086edw.144.2020.09.13.05.06.37; Sun, 13 Sep 2020 05:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HYmWTVRA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725932AbgIMMF5 (ORCPT + 99 others); Sun, 13 Sep 2020 08:05:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbgIMMFy (ORCPT ); Sun, 13 Sep 2020 08:05:54 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EFCEC061573 for ; Sun, 13 Sep 2020 05:05:54 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id t14so9348511pgl.10 for ; Sun, 13 Sep 2020 05:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=Vsq2EpPAKnreG44my/rSP6OLukd3irJGMACNHFoXfQY=; b=HYmWTVRAYowkmPtIwoh8IMtZfBpEB+hW13kFz/ZbqJiDanEKc2ukG5aqno/ZP2drHO W6u2eDXPd7pvwPu9exeIuDbvm1V/ECO6BKGxbABqCr5RyexmTO+5IhLYTJYareQcOdd4 aJdb7+z6xOcc91CXk9xCPUt04nUPYBKbI9vvRn7BNA5qYd6mFu6F2+GvRyPKL+o7kIkc giPNgHA9ReulRKDx4ZYY3FXR4HBR6axakt6J6ZvlT9/s4uDYetvGFtES1To27ub2FEvx /hk1BV3DrcZzA5GvXRlk2NTqSIFobUExVC2uggr07/pBU2Z1YD/O/QHwLcb6iNC6U25x 3v+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=Vsq2EpPAKnreG44my/rSP6OLukd3irJGMACNHFoXfQY=; b=lPUTb+3hkMlZadk4ay3QLIbChvLjkiv5cMMZB1uUY6basK4fE7WMP2yHwq57TovADS 9E/uOv2APTihW7FYZJPELTQy2UyncjzmjB0RbIxNFcxOFBMJKWF+VECxRzJvIAsLDrtF vbwvOJHWe9y7if3JeHltLSQYHu7zZnAZhja8QJ7c7EvAlIjYGncqj1wHIMA+nL/nx8UF r4t1f9H4d2BfgIGZaxmVBmhvnJ8H1TBu9jzdLDL0z7m3JKQDK6ykmdI7A729RD7ZtNBI FegLeVH/w3JUVpkx0ixu5kRas6dLMBjD/6TQLKEBDhhSO+UZobFU8SPUFVHnIH0uJozz MdNA== X-Gm-Message-State: AOAM5325ky/+VUHKcxltQK49HZ9FwctpZpKxK6n1erNV5lAxwaH//WKq tdJb5RJ6ltMw+84w+X5dp5hCYwCiDaP1mg== X-Received: by 2002:a62:864e:: with SMTP id x75mr9419816pfd.60.1599998753546; Sun, 13 Sep 2020 05:05:53 -0700 (PDT) Received: from adolin ([49.207.213.41]) by smtp.gmail.com with ESMTPSA id x19sm5925722pge.22.2020.09.13.05.05.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 05:05:52 -0700 (PDT) Date: Sun, 13 Sep 2020 17:35:48 +0530 From: Sumera Priyadarsini To: Julia.Lawall@lip6.fr Cc: Gilles.Muller@lip6.fr, nicolas.palix@imag.fr, michal.lkml@markovi.net, cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Subject: [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails Message-ID: <20200913120548.bwl3elfl7ss66eyh@adolin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, coccicheck fails with only the message "coccicheck failed" and the error code for the failure. To obtain the error logs, one needs to specify a debug file using the DEBUG_FILE option. Modify coccicheck to display error logs when it crashes unless DEBUG_FILE is set, in which case, the error logs are stored in the specified debug file. Signed-off-by: Sumera Priyadarsini --- scripts/coccicheck | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index e04d328210ac..dbeafa21f359 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -126,8 +126,14 @@ run_cmd_parmap() { if [ $VERBOSE -ne 0 ] ; then echo "Running ($NPROC in parallel): $@" fi - echo $@ >>$DEBUG_FILE - $@ 2>>$DEBUG_FILE + if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then + echo $@>>$DEBUG_FILE + $@ 2>>$DEBUG_FILE + else + echo $@ + $@ 2>&1 + fi + err=$? if [[ $err -ne 0 ]]; then echo "coccicheck failed" -- 2.25.1