Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp942225imm; Wed, 1 Aug 2018 07:45:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd6ot4rCjVQn+fjRo17nt8fK/TXNCJPe+eZVSC7csvbyRTu3wDiH8cBsfL7baHDLxdjBPNf X-Received: by 2002:a62:a018:: with SMTP id r24-v6mr27230672pfe.144.1533134759798; Wed, 01 Aug 2018 07:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533134759; cv=none; d=google.com; s=arc-20160816; b=ZgpxWOr+LnP/oTQpoIbWftfyIYgmO/0fnxe8P4yrW0kwNUX59UzfovW3YYXr2fJ3FI HzohkWmdstomVjr9mxQWNKGemTC5koLovShe3AB7u1nQOD8UxDFU9W2mnV7FUJItiQzA VZ1qf8f949C9C/zwcVdrP3iCxadKUqmpk+IDyacXvgAoHjnTEP0G3dsCDmeqrEQ3gJRr iGEYhhyVJ5+R0ho+MMUQoVLWAr52bjUYQZno4L6ZQNsPwiY/98kV9eWJDU+PK1T18KQe 8yU9y/xGeZKz1NNO6F90YP0bnMTbDlF5JRcJajN8iKDfQYhkgCvWZ0OhOT9Hep+kF+mT HnJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:subject:cc:to:from:date:arc-authentication-results; bh=cNexah7vKuundFR4jxHAT5LWx9oIfyF+yyKw1KJcL8s=; b=lGxdQ57pH0176eSjRzNwpqER+BgQEbKnSl3S28ypQ6Gjs/qju+pcGIg9MHs+5GNhJ3 06bWAMob/JvR448T/pS48v0Z7VYcVrr2bxQqVtpjIPA4FNz44W6Ueee9cYTrLRV6DCgm MsFrTG8BT3tqzgOg8UyKiWbIJF3oRD4G6psDmljs9d6HKLogX79sdGOQHFJAgxJpihIS SzaqdUaB5XjHYvKO4aJBXSoIFGUX5UvTei0SfupZ0dd1rd8BsGlrXZ58CaU/oHo3mDXo wD2qplSBlgBinkkNDG08863XykriSeDG/9azy4YexMJrzL+EuIduAXkhrUOJlXjuwAdJ EqOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15-v6si16864217pgc.309.2018.08.01.07.45.45; Wed, 01 Aug 2018 07:45:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389635AbeHAQai (ORCPT + 99 others); Wed, 1 Aug 2018 12:30:38 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36534 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389450AbeHAQah (ORCPT ); Wed, 1 Aug 2018 12:30:37 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w71EhkkB066828 for ; Wed, 1 Aug 2018 10:44:33 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kkdhgkq8q-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 01 Aug 2018 10:44:33 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Aug 2018 10:44:32 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 1 Aug 2018 10:44:29 -0400 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w71EiS7O10158580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 1 Aug 2018 14:44:28 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3F141AE062; Wed, 1 Aug 2018 10:43:34 -0400 (EDT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 70331AE05F; Wed, 1 Aug 2018 10:43:33 -0400 (EDT) Received: from localhost (unknown [9.80.99.86]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTPS; Wed, 1 Aug 2018 10:43:33 -0400 (EDT) Date: Wed, 1 Aug 2018 11:44:25 -0300 From: Murilo Opsfelder Araujo To: Segher Boessenkool Cc: Joe Perches , Christophe LEROY , linux-kernel@vger.kernel.org, Michael Neuling , Simon Guo , Nicholas Piggin , Paul Mackerras , "Eric W . Biederman" , Andrew Donnellan , "Alastair D'Silva" , Sukadev Bhattiprolu , linuxppc-dev@lists.ozlabs.org, Cyril Bur , "Tobin C . Harding" Subject: Re: [PATCH v3 5/9] powerpc/traps: Print signal name for unhandled signals References: <20180731145020.14009-1-muriloo@linux.ibm.com> <20180731145020.14009-6-muriloo@linux.ibm.com> <631e9a9b-dbbe-ede7-eb81-81520cc36ad5@c-s.fr> <20180801074903.GG16221@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180801074903.GG16221@gate.crashing.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 x-cbid: 18080114-0052-0000-0000-000003167B18 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009467; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01068847; UDB=6.00549526; IPR=6.00847160; MB=3.00022441; MTD=3.00000008; XFM=3.00000015; UTC=2018-08-01 14:44:32 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18080114-0053-0000-0000-00005D90F2C8 Message-Id: <20180801144425.GB6022@kermit-br-ibm-com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-01_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1808010153 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Segher. On Wed, Aug 01, 2018 at 02:49:03AM -0500, Segher Boessenkool wrote: > On Wed, Aug 01, 2018 at 12:03:50AM -0700, Joe Perches wrote: > > On Wed, 2018-08-01 at 08:37 +0200, Christophe LEROY wrote: > > > Le 31/07/2018 ? 16:50, Murilo Opsfelder Araujo a ?crit : > > > I would suggest to instead use a function like this: > > > > > > static const char *signame(int signr) > > > { > > > if (signr == SIGBUS) > > > return "bus error"; > > > if (signr == SIGFPE) > > > return "floating point exception"; > > > if (signr == SIGILL) > > > return "illegal instruction"; > > > if (signr == SIGILL) > > > return "segfault"; > > > if (signr == SIGTRAP) > > > return "unhandled trap"; > > > return "unknown signal"; > > > } > > > > trivia: > > > > Unless the if tests are ordered most to least likely, > > perhaps it would be better to use a switch/case and > > let the compiler decide. > > That would also show there are two entries for SIGILL (here and in the > original patch), one of them very wrong. Good catch. I'll take care of that in my next respin. > Check the table with psignal or something? Nice suggestion. Thanks! Cheers Murilo