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]
Date:	Fri, 28 Mar 2008 01:35:09 -0400
From:	Masami Hiramatsu <mhiramat@...hat.com>
To:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
CC:	Denys Vlasenko <vda.linux@...glemail.com>,
	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Markers - remove extra format argument

Hi Mathieu,

Mathieu Desnoyers wrote:
> Denys Vlasenko <vda.linux@...glemail.com> :
>> In this call:
>>
>>                         (*__mark_##name.call)                           \
>>                                 (&__mark_##name, call_private,          \
>>                                 format, ## args);                       \
>>
>> you make gcc allocate duplicate format string. You can use
>> &__mstrtab_##name[sizeof(#name)] instead since it holds the same string,
>> or drop ", format," above and "const char *fmt" from here:
>>
>>         void (*call)(const struct marker *mdata,        /* Probe wrapper */
>>                 void *call_private, const char *fmt, ...);
>>
>> since mdata->format is the same and all callees which need it can take it there.
> 
> Very good point. I actually thought about dropping it, since it would
> remove an unnecessary argument from the stack. And actually, since I now
> have the marker_probe_cb sitting between the marker site and the
> callbacks, there is no API change required. Thanks :)

First of all, I'm very interested in the marker, and your patches look
useful for me.

By the way, could you tell me what the call_private is for?
In your patch, that is used only from special function below.

> @@ -1844,3 +1848,22 @@ int valid_swaphandles(swp_entry_t entry,
>  	*offset = ++toff;
>  	return nr_pages? ++nr_pages: 0;
>  }
> +
> +void ltt_dump_swap_files(void *call_data)
> +{
> +	int type;
> +	struct swap_info_struct *p = NULL;
> +
> +	mutex_lock(&swapon_mutex);
> +	for (type = swap_list.head; type >= 0; type = swap_info[type].next) {
> +		p = swap_info + type;
> +		if ((p->flags & SWP_ACTIVE) != SWP_ACTIVE)
> +			continue;
> +		__trace_mark(0, statedump_swap_files, call_data,
> +			"filp %p vfsmount %p dname %s",
> +			p->swap_file, p->swap_file->f_vfsmnt,
> +			p->swap_file->f_dentry->d_name.name);
> +	}
> +	mutex_unlock(&swapon_mutex);
> +}
> +EXPORT_SYMBOL_GPL(ltt_dump_swap_files);
> 

However, I think call_data can be passed as an argument.
If so, I think you can also drop it, like this.

 void (*call)(const struct marker *mdata, ...);


Best regards,

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@...hat.com

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ