public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch 4/5] Linux Kernel Markers - Samples
Date: Thu, 11 Oct 2007 09:27:12 -0400	[thread overview]
Message-ID: <20071011132712.GA3580@Krystal> (raw)
In-Reply-To: <20071011021355.53302c04.akpm@linux-foundation.org>

* Andrew Morton (akpm@linux-foundation.org) wrote:
> On Fri, 28 Sep 2007 10:28:49 -0400 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:
> 
> > Module example showing how to use the Linux Kernel Markers.
> 
> s390:
> 
> samples/markers/marker-example.c: In function 'my_open':
> samples/markers/marker-example.c:22: warning: asm operand 0 probably doesn't match constraints
> samples/markers/marker-example.c:24: warning: asm operand 0 probably doesn't match constraints
> samples/markers/marker-example.c:22: error: impossible constraint in 'asm'
> samples/markers/marker-example.c:24: error: impossible constraint in 'asm'

Hrm, I have s390 gcc-4.1.1 here and cannot reproduce the problem with it.

What compiler are you using ?

This is clearly caused by the :
  asm volatile ("" : : "i" (&__mark_##name));

It is there to specify that the __mark_##name variable is used. In the
first implementations, I did not pass it as a parameter to the following
function call, so I had to find a way to tell gcc that it should not go
away. I first planned to use a "__used" attribute, but Jeremy said it
was buggy on some gcc versions. (http://lkml.org/lkml/2006/10/17/235)

He suggested the following:
  asm volatile("" : : "m" (thing));

But I guess it ended up not working so well, since I changed it for a
"i" operand. However, if some s390 gccs do not like it, it's better to
figure out another solution.

Well, as a very very simple solution, let's just remove the asm. It is
not needed anymore since the pointer is passed as parameter to the
called function.

The patch follows.

Mathieu


Linux Kernel Markers - Remove Unneeded asm

On s390 (with some compiler) :

> samples/markers/marker-example.c: In function 'my_open':
> samples/markers/marker-example.c:22: warning: asm operand 0 probably doesn't
> match constraints
> samples/markers/marker-example.c:24: warning: asm operand 0 probably doesn't
> match constraints
> samples/markers/marker-example.c:22: error: impossible constraint in 'asm'
> samples/markers/marker-example.c:24: error: impossible constraint in 'asm'

It is there to specify that the __mark_##name variable is used. In the
first implementations, I did not pass it as a parameter to the following
function call, so I had to find a way to tell gcc that it should not go
away. I first planned to use a "__used" attribute, but Jeremy said it
was buggy on some gcc versions. (http://lkml.org/lkml/2006/10/17/235)

He suggested the following:
  asm volatile("" : : "m" (thing));

But I guess it ended up not working so well, since I changed it for a
"i" operand. However, if some s390 gccs do not like it, it's better to
figure out another solution.

Well, as a very very simple solution, let's just remove the asm. It is
not needed anymore since the pointer is passed as parameter to the
called function.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
---
 include/linux/marker.h |    1 -
 1 file changed, 1 deletion(-)

Index: linux-2.6-lttng/include/linux/marker.h
===================================================================
--- linux-2.6-lttng.orig/include/linux/marker.h	2007-10-11 09:20:04.000000000 -0400
+++ linux-2.6-lttng/include/linux/marker.h	2007-10-11 09:20:23.000000000 -0400
@@ -61,7 +61,6 @@ struct marker {
 		__attribute__((section("__markers"), aligned(8))) =	\
 		{ __mstrtab_name_##name, __mstrtab_format_##name,	\
 		0, __mark_empty_function, NULL };			\
-		asm volatile ("" : : "i" (&__mark_##name));		\
 		__mark_check_format(format, ## args);			\
 		if (unlikely(__mark_##name.state)) {			\
 			preempt_disable();				\
-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

  reply	other threads:[~2007-10-11 13:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-28 14:28 [patch 0/5] Linux Kernel Markers for 2.6.23-rc8-mm2 Mathieu Desnoyers
2007-09-28 14:28 ` [patch 1/5] Combine instrumentation menus in kernel/Kconfig.instrumentation Mathieu Desnoyers
2007-09-28 14:28 ` [patch 2/5] Linux Kernel Markers Mathieu Desnoyers
2007-09-30  1:35   ` Rusty Russell
2007-09-30 14:00     ` Linux Kernel Markers - Coding Style Fixes Mathieu Desnoyers
2007-09-30 14:04       ` Mathieu Desnoyers
2007-10-02 12:10       ` [PATCH] Linux Kernel Markers - Alignment Fix Mathieu Desnoyers
2007-10-01 16:01     ` [PATCH] Change struct marker users Mathieu Desnoyers
2007-09-28 14:28 ` [patch 3/5] Add samples subdir Mathieu Desnoyers
2007-09-28 15:47   ` Randy Dunlap
2007-09-28 16:24     ` Mathieu Desnoyers
2007-09-28 14:28 ` [patch 4/5] Linux Kernel Markers - Samples Mathieu Desnoyers
2007-09-30 14:07   ` [PATCH] Linux Kernel Markers - Samples Coding Style Fix Mathieu Desnoyers
2007-10-11  9:13   ` [patch 4/5] Linux Kernel Markers - Samples Andrew Morton
2007-10-11 13:27     ` Mathieu Desnoyers [this message]
2007-10-11 18:32       ` Andrew Morton
2007-09-28 14:28 ` [patch 5/5] Linux Kernel Markers - Documentation Mathieu Desnoyers
  -- strict thread matches above, loose matches on Subject: below --
2007-09-25 12:11 [patch 0/5] Linux Kernel Markers (redux) Mathieu Desnoyers
2007-09-25 12:11 ` [patch 4/5] Linux Kernel Markers - Samples 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=20071011132712.GA3580@Krystal \
    --to=mathieu.desnoyers@polymtl.ca \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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