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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A85A9C433F5 for ; Mon, 3 Oct 2022 21:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbiJCV1h (ORCPT ); Mon, 3 Oct 2022 17:27:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbiJCV1L (ORCPT ); Mon, 3 Oct 2022 17:27:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4F295BC0D for ; Mon, 3 Oct 2022 14:17:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 81B6AB815FB for ; Mon, 3 Oct 2022 21:17:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3F4FC433D6; Mon, 3 Oct 2022 21:17:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1664831833; bh=R79UHR49+cXdxY8Lzokv7OALE2VQe1R1YCemJrDV0ww=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SXo8NeGfnawnAbcWrPKG3bJGNF/FPDIQJz5mRJjcmarNGdWkqJAQM7NoLHRXFFCZd gZjhHq5zbZs9UsGgfMDVJCyOkhretNMQ8kgHtDudzcoJgQUrlUmqe6/OVKrrTWPPuI WhBrQFeI093tvqpVEJs9cwpW3wipxIY2eNBQYJ0U= Date: Mon, 3 Oct 2022 14:17:12 -0700 From: Andrew Morton To: Akinobu Mita Cc: Wei Yongjun , Nathan Chancellor , Peter Zijlstra , Kees Cook , Nick Desaulniers , Josh Poimboeuf , Dan Williams , Miguel Ojeda , Isabella Basso , Vlastimil Babka , Rasmus Villemoes , LKML Subject: Re: [PATCH 3/4 -next] fault-injection: make some stack filter attrs more readable Message-Id: <20221003141712.ff7aceb8e29073f3aa9be2ec@linux-foundation.org> In-Reply-To: References: <20220817080332.1052710-1-weiyongjun1@huawei.com> <20220817080332.1052710-4-weiyongjun1@huawei.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 19 Aug 2022 22:24:10 +0900 Akinobu Mita wrote: > 2022年8月17日(水) 16:45 Wei Yongjun : > > > > Attributes of stack filter are show as unsigned decimal, such > > as 'require-start', 'require-end'. This patch change to > > show them as unsigned hexadecimal for more readable. > > > > Before: > > $ echo 0xffffffffc0257000 > /sys/kernel/debug/failslab/require-start > > $ cat /sys/kernel/debug/failslab/require-start > > 18446744072638263296 > > > > After: > > $ echo 0xffffffffc0257000 > /sys/kernel/debug/failslab/require-start > > $ cat /sys/kernel/debug/failslab/require-start > > 0xffffffffc0257000 > > > > Signed-off-by: Wei Yongjun > > --- > > lib/fault-inject.c | 16 ++++++++++++---- > > 1 file changed, 12 insertions(+), 4 deletions(-) > > > > diff --git a/lib/fault-inject.c b/lib/fault-inject.c > > index 515fc5aaf032..deca05e7c9b3 100644 > > --- a/lib/fault-inject.c > > +++ b/lib/fault-inject.c > > @@ -179,6 +179,14 @@ static void debugfs_create_ul(const char *name, umode_t mode, > > > > #ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER > > > > +DEFINE_SIMPLE_ATTRIBUTE(fops_xl, debugfs_ul_get, debugfs_ul_set, "0x%llx\n"); > > + > > +static void debugfs_create_xl(const char *name, umode_t mode, > > + struct dentry *parent, unsigned long *value) > > +{ > > + debugfs_create_file(name, mode, parent, value, &fops_xl); > > +} > > How about using an existing `debugfs_create_xul()` instead of defining > a local helper function? Could we please have a response to this?