[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cba75ee4d88afdf118631510ad0f971e42c1a31c.camel@perches.com>
Date: Sun, 23 Feb 2020 15:50:43 -0800
From: Joe Perches <joe@...ches.com>
To: Kaaira Gupta <kgupta@...iitr.ac.in>,
Manish Chopra <manishc@...vell.com>,
GR-Linux-NIC-Dev@...vell.com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
netdev@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] staging: qlge: emit debug and dump at same level
On Sun, 2020-02-23 at 23:01 +0530, Kaaira Gupta wrote:
> Simplify code in ql_mpi_core_to_log() by calling print_hex_dump()
> instead of existing functions so that the debug and dump are
> emitted at the same KERN_<LEVEL>
[]
> Also, can you please help me understand how are are numbers 32 and 4
> chosen for the function print_hex_dump()?
Emit 32 bytes per line in 4 byte chunks as u32
And below:
> diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
[]
> @@ -1324,27 +1324,10 @@ void ql_mpi_core_to_log(struct work_struct *work)
> {
> struct ql_adapter *qdev =
> container_of(work, struct ql_adapter, mpi_core_to_log.work);
[]
> + print_hex_dump(KERN_DEBUG, "Core is dumping to log file!\n",
> + DUMP_PREFIX_OFFSET, 32, 4, qdev->mpi_coredump,
> + sizeof(*qdev->mpi_coredump), false);
This use of a prefix string is not acceptable.
>From the kernel-doc:
/**
* print_hex_dump - print a text hex dump to syslog for a binary blob of data
* @level: kernel log level (e.g. KERN_DEBUG)
* @prefix_str: string to prefix each line with;
* caller supplies trailing spaces for alignment if desired
So this would emit "Core is dumping..." line for for
every line of hex output.
Powered by blists - more mailing lists