lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250401040609.GA11465@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
Date: Mon, 31 Mar 2025 21:06:09 -0700
From: Shradha Gupta <shradhagupta@...ux.microsoft.com>
To: Dexuan Cui <decui@...rosoft.com>
Cc: KY Srinivasan <kys@...rosoft.com>,
	Haiyang Zhang <haiyangz@...rosoft.com>,
	Wei Liu <wei.liu@...nel.org>,
	"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Shradha Gupta <shradhagupta@...rosoft.com>
Subject: Re: [PATCH v2] hv/hv_kvp_daemon: Enable debug logs for hv_kvp_daemon

On Mon, Mar 31, 2025 at 11:20:09PM +0000, Dexuan Cui wrote:
> > From: Shradha Gupta <shradhagupta@...ux.microsoft.com>
> > Sent: Sunday, March 30, 2025 11:15 PM
> > [...]
> > +static void convert_tm_to_string(char *tm_str, size_t tm_str_size)
> > +{
> > +	struct tm tm;
> > +	time_t t;
> > +
> > +	time(&t);
> > +	gmtime_r(&t, &tm);
> > +	strftime(tm_str, tm_str_size, "%Y-%m-%dT%H:%M:%S", &tm);
> > +}
> 
> Now the function is unnecessary since v2 uses syslog(), which already prefixes every
> message with a timestamp.

Hi Dexuan,
I have deliberately kept this timestamp in the raw message so that
if/whenever they are redirected to other file, irrespective of the
configuration of the syslog we have valid timestamp for debugging
> 
> > +static void kvp_dump_initial_pools(int pool)
> > +{
> > +	char tm_str[50];
> > +	int i;
> > +
> > +	convert_tm_to_string(tm_str, sizeof(tm_str));
> This is unnecessary now.
> 
> > +	syslog(LOG_DEBUG, "===Start dumping the contents of pool %d
> > ===\n",
> > +	       pool);
> > +
> > +	for (i = 0; i < kvp_file_info[pool].num_records; i++)
> > +		syslog(LOG_DEBUG, "[%s]: pool: %d, %d/%d key=%s
> > val=%s\n",
> > +		       tm_str, pool, i, kvp_file_info[pool].num_records,
> 
> Can you change the 'i' to 'i+1'? This makes the messages a little more natural to
> users who are not programmers :-)
sure, but I am just worried that might cause confusion when someone
tried to co-relate it with the actual kv_pool_{i} contents that start
with 0.
> 
> >  static int kvp_key_add_or_modify(int pool, const __u8 *key, int key_size,
> 
> Can you add a log message for KVP_OP_DELETE as well?
sure, I can add this.
> 
> Thanks,
> Dexuan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ