public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Denys Vlasenko <vda.linux@googlemail.com>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Markers - remove extra format argument
Date: Fri, 28 Mar 2008 01:35:09 -0400	[thread overview]
Message-ID: <47EC838D.9060309@redhat.com> (raw)
In-Reply-To: <20080328010223.GA8186@Krystal>

Hi Mathieu,

Mathieu Desnoyers wrote:
> Denys Vlasenko <vda.linux@googlemail.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@redhat.com


  reply	other threads:[~2008-03-28  5:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-27 13:20 [patch for 2.6.26 0/7] Architecture Independent Markers Mathieu Desnoyers
2008-03-27 13:20 ` [patch for 2.6.26 1/7] Markers - define non optimized marker Mathieu Desnoyers
2008-03-27 13:20 ` [patch for 2.6.26 2/7] LTTng instrumentation fs Mathieu Desnoyers
2008-03-27 13:21 ` [patch for 2.6.26 3/7] LTTng instrumentation ipc Mathieu Desnoyers
2008-03-27 13:21 ` [patch for 2.6.26 4/7] LTTng instrumentation kernel Mathieu Desnoyers
2008-03-27 13:21 ` [patch for 2.6.26 5/7] LTTng instrumentation mm Mathieu Desnoyers
2008-03-27 13:21 ` [patch for 2.6.26 6/7] LTTng instrumentation net Mathieu Desnoyers
2008-03-27 13:21 ` [patch for 2.6.26 7/7] LTTng instrumentation - lib Mathieu Desnoyers
2008-03-27 15:40 ` [patch for 2.6.26 0/7] Architecture Independent Markers Ingo Molnar
2008-03-27 17:08   ` KOSAKI Motohiro
2008-03-28 10:15     ` Ingo Molnar
2008-03-28 13:34       ` [OT] " Masami Hiramatsu
2008-04-01  1:43         ` Denys Vlasenko
2008-04-01 14:30           ` Masami Hiramatsu
2008-03-28 13:40       ` Frank Ch. Eigler
2008-03-28 14:18         ` Ingo Molnar
2008-03-28 14:41         ` Ingo Molnar
2008-03-28 15:31           ` Frank Ch. Eigler
2008-03-27 20:39   ` Mathieu Desnoyers
2008-03-28  9:43     ` Ingo Molnar
2008-03-28 11:22       ` Ingo Molnar
2008-03-28 11:38       ` Mathieu Desnoyers
2008-03-28 13:33     ` Ingo Molnar
2008-03-29 17:16       ` Mathieu Desnoyers
2008-03-27 21:49   ` Frank Ch. Eigler
2008-03-28  0:01 ` Denys Vlasenko
2008-03-28  1:02   ` [PATCH] Markers - remove extra format argument Mathieu Desnoyers
2008-03-28  5:35     ` Masami Hiramatsu [this message]
2008-03-28  1:04   ` [patch for 2.6.26 1/7] Markers - define non optimized marker (updated) Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47EC838D.9060309@redhat.com \
    --to=mhiramat@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=vda.linux@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox