public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Script with static probe point throws error in Pass 3
@ 2009-01-18 16:40 beginner966
  2009-01-20 22:35 ` David Smith
  0 siblings, 1 reply; 8+ messages in thread
From: beginner966 @ 2009-01-18 16:40 UTC (permalink / raw)
  To: systemtap


I got the following error while probing static probe points.

Pass 3: translated to C into
"/tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c" in
1030usr/550sys/2102real ms.
Running make -C "/lib/modules/2.6.26.5-rt9/build" M="/tmp/stapS8IQsL"
modules >/dev/null
cc1: warnings being treated as errors
/tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c: In function
âsystemtap_module_initâ:
/tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c:853: warning:
passing argument 3 of âmarker_probe_registerâ from incompatible pointer type
/tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c:857: warning:
passing argument 2 of âmarker_probe_unregisterâ from incompatible pointer
type
/tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c: In function
âsystemtap_module_exitâ:
/tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c:945: warning:
passing argument 2 of âmarker_probe_unregisterâ from incompatible pointer
type


Please suggest some solutions. Thanks.
-- 
View this message in context: http://www.nabble.com/Script-with-static-probe-point-throws-error-in-Pass-3-tp21528274p21528274.html
Sent from the Sourceware - systemtap mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Script with static probe point throws error in Pass 3
  2009-01-18 16:40 Script with static probe point throws error in Pass 3 beginner966
@ 2009-01-20 22:35 ` David Smith
  2009-01-21 10:13   ` beginner966
  0 siblings, 1 reply; 8+ messages in thread
From: David Smith @ 2009-01-20 22:35 UTC (permalink / raw)
  To: beginner966; +Cc: systemtap

beginner966 wrote:
> I got the following error while probing static probe points.
> 
> Pass 3: translated to C into
> "/tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c" in
> 1030usr/550sys/2102real ms.
> Running make -C "/lib/modules/2.6.26.5-rt9/build" M="/tmp/stapS8IQsL"
> modules >/dev/null
> cc1: warnings being treated as errors
> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c: In function
> âsystemtap_module_initâ:
> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c:853: warning:
> passing argument 3 of âmarker_probe_registerâ from incompatible pointer type
> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c:857: warning:
> passing argument 2 of âmarker_probe_unregisterâ from incompatible pointer
> type
> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c: In function
> âsystemtap_module_exitâ:
> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c:945: warning:
> passing argument 2 of âmarker_probe_unregisterâ from incompatible pointer
> type
> 
> 
> Please suggest some solutions. Thanks.

Hmm.  I can't think of why we'd have trouble calling
marker_probe_register()/marker_probe_unregister().  The calling
conventions for those haven't changed that I can recall.

Can you show me the declarations for those two functions from
linux/marker.h?  They should look like:

----
extern int marker_probe_register(const char *name, const char *format,
                      marker_probe_func *probe, void *probe_private);

extern int marker_probe_unregister(const char *name,
        marker_probe_func *probe, void *probe_private);
----

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Script with static probe point throws error in Pass 3
  2009-01-20 22:35 ` David Smith
@ 2009-01-21 10:13   ` beginner966
  2009-01-21 12:13     ` beginner966
                       ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: beginner966 @ 2009-01-21 10:13 UTC (permalink / raw)
  To: systemtap


This is the declaration as given in the linux/marker.h file

/*
 * Connect a probe to a marker.
 * private data pointer must be a valid allocated memory address, or NULL.
 */
extern int marker_probe_register(const char *name, const char *format,
                                marker_probe_func *probe, void
*probe_private);

/*
 * Returns the private data given to marker_probe_register.
 */
extern int marker_probe_unregister(const char *name,
        marker_probe_func *probe, void *probe_private);


These are the 4 different marker that I'd put up in kernel/sched.c

1) if (unlikely(cpu_is_offline(dest_cpu)))
        {
                trace_mark(__migrate_task_cpu_offline,"CPU:%d
offline",dest_cpu);
                return ret;
        }

2) if (task_cpu(p) != src_cpu)
        {
                trace_mark(__migrate_task_already_moved,"Already moved to
CPU:%d",dest_cpu);
                goto done;
        }

3) if (!cpu_isset(dest_cpu, p->cpus_allowed))
        {
                trace_mark(__migrate_task_affinity_changed,"CPU
Mask:%lu",(unsigned long)p->cpus_allowed.bits[0]);
                goto fail;
        }
4) set_task_cpu(p, dest_cpu);
        trace_mark(migrate_task_done,"%s","Success");



David Smith-19 wrote:
> 
> beginner966 wrote:
>> I got the following error while probing static probe points.
>> 
>> Pass 3: translated to C into
>> "/tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c" in
>> 1030usr/550sys/2102real ms.
>> Running make -C "/lib/modules/2.6.26.5-rt9/build" M="/tmp/stapS8IQsL"
>> modules >/dev/null
>> cc1: warnings being treated as errors
>> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c: In function
>> âsystemtap_module_initâ:
>> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c:853:
>> warning:
>> passing argument 3 of âmarker_probe_registerâ from incompatible pointer
>> type
>> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c:857:
>> warning:
>> passing argument 2 of âmarker_probe_unregisterâ from incompatible pointer
>> type
>> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c: In function
>> âsystemtap_module_exitâ:
>> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c:945:
>> warning:
>> passing argument 2 of âmarker_probe_unregisterâ from incompatible pointer
>> type
>> 
>> 
>> Please suggest some solutions. Thanks.
> 
> Hmm.  I can't think of why we'd have trouble calling
> marker_probe_register()/marker_probe_unregister().  The calling
> conventions for those haven't changed that I can recall.
> 
> Can you show me the declarations for those two functions from
> linux/marker.h?  They should look like:
> 
> ----
> extern int marker_probe_register(const char *name, const char *format,
>                       marker_probe_func *probe, void *probe_private);
> 
> extern int marker_probe_unregister(const char *name,
>         marker_probe_func *probe, void *probe_private);
> ----
> 
> -- 
> David Smith
> dsmith@redhat.com
> Red Hat
> http://www.redhat.com
> 256.217.0141 (direct)
> 256.837.0057 (fax)
> 
> 

-- 
View this message in context: http://www.nabble.com/Script-with-static-probe-point-throws-error-in-Pass-3-tp21528274p21576382.html
Sent from the Sourceware - systemtap mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Script with static probe point throws error in Pass 3
  2009-01-21 10:13   ` beginner966
@ 2009-01-21 12:13     ` beginner966
  2009-01-21 14:55     ` beginner966
  2009-01-21 20:39     ` David Smith
  2 siblings, 0 replies; 8+ messages in thread
From: beginner966 @ 2009-01-21 12:13 UTC (permalink / raw)
  To: systemtap


This is the script which I used:

probe kernel.mark("migrate_task_done")
{
                printf("\nSuccess: Task successfully migrated\n\n");
}


And this is its corresponding C file generated by stap: 
http://www.nabble.com/file/p21581939/stap_file stap_file 

beginner966 wrote:
> 
> 
> 
> This is the declaration as given in the linux/marker.h file
> 
> /*
>  * Connect a probe to a marker.
>  * private data pointer must be a valid allocated memory address, or NULL.
>  */
> extern int marker_probe_register(const char *name, const char *format,
>                                 marker_probe_func *probe, void
> *probe_private);
> 
> /*
>  * Returns the private data given to marker_probe_register.
>  */
> extern int marker_probe_unregister(const char *name,
>         marker_probe_func *probe, void *probe_private);
> 
> 
> These are the 4 different marker that I'd put up in kernel/sched.c
> 
> 1) if (unlikely(cpu_is_offline(dest_cpu)))
>         {
>                 trace_mark(__migrate_task_cpu_offline,"CPU:%d
> offline",dest_cpu);
>                 return ret;
>         }
> 
> 2) if (task_cpu(p) != src_cpu)
>         {
>                 trace_mark(__migrate_task_already_moved,"Already moved to
> CPU:%d",dest_cpu);
>                 goto done;
>         }
> 
> 3) if (!cpu_isset(dest_cpu, p->cpus_allowed))
>         {
>                 trace_mark(__migrate_task_affinity_changed,"CPU
> Mask:%lu",(unsigned long)p->cpus_allowed.bits[0]);
>                 goto fail;
>         }
> 4) set_task_cpu(p, dest_cpu);
>         trace_mark(migrate_task_done,"%s","Success");
> 
> 
> 
> David Smith-19 wrote:
>> 
>> beginner966 wrote:
>>> I got the following error while probing static probe points.
>>> 
>>> Pass 3: translated to C into
>>> "/tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c" in
>>> 1030usr/550sys/2102real ms.
>>> Running make -C "/lib/modules/2.6.26.5-rt9/build" M="/tmp/stapS8IQsL"
>>> modules >/dev/null
>>> cc1: warnings being treated as errors
>>> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c: In
>>> function
>>> âsystemtap_module_initâ:
>>> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c:853:
>>> warning:
>>> passing argument 3 of âmarker_probe_registerâ from incompatible pointer
>>> type
>>> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c:857:
>>> warning:
>>> passing argument 2 of âmarker_probe_unregisterâ from incompatible
>>> pointer
>>> type
>>> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c: In
>>> function
>>> âsystemtap_module_exitâ:
>>> /tmp/stapS8IQsL/stap_ef975aa4108a2079c82c8d4c7d4fccaf_1986.c:945:
>>> warning:
>>> passing argument 2 of âmarker_probe_unregisterâ from incompatible
>>> pointer
>>> type
>>> 
>>> 
>>> Please suggest some solutions. Thanks.
>> 
>> Hmm.  I can't think of why we'd have trouble calling
>> marker_probe_register()/marker_probe_unregister().  The calling
>> conventions for those haven't changed that I can recall.
>> 
>> Can you show me the declarations for those two functions from
>> linux/marker.h?  They should look like:
>> 
>> ----
>> extern int marker_probe_register(const char *name, const char *format,
>>                       marker_probe_func *probe, void *probe_private);
>> 
>> extern int marker_probe_unregister(const char *name,
>>         marker_probe_func *probe, void *probe_private);
>> ----
>> 
>> -- 
>> David Smith
>> dsmith@redhat.com
>> Red Hat
>> http://www.redhat.com
>> 256.217.0141 (direct)
>> 256.837.0057 (fax)
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Script-with-static-probe-point-throws-error-in-Pass-3-tp21528274p21581939.html
Sent from the Sourceware - systemtap mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Script with static probe point throws error in Pass 3
  2009-01-21 10:13   ` beginner966
  2009-01-21 12:13     ` beginner966
@ 2009-01-21 14:55     ` beginner966
  2009-01-21 20:39     ` David Smith
  2 siblings, 0 replies; 8+ messages in thread
From: beginner966 @ 2009-01-21 14:55 UTC (permalink / raw)
  To: systemtap


This is the script which I used:

probe kernel.mark("migrate_task_done")
{
                printf("\nSuccess: Task successfully migrated\n\n");
}


And this is its corresponding C file generated by stap: 
http://www.nabble.com/file/p21581959/stap_file stap_file 

-- 
View this message in context: http://www.nabble.com/Script-with-static-probe-point-throws-error-in-Pass-3-tp21528274p21581959.html
Sent from the Sourceware - systemtap mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Script with static probe point throws error in Pass 3
  2009-01-21 10:13   ` beginner966
  2009-01-21 12:13     ` beginner966
  2009-01-21 14:55     ` beginner966
@ 2009-01-21 20:39     ` David Smith
  2009-01-22 13:10       ` beginner966
  2 siblings, 1 reply; 8+ messages in thread
From: David Smith @ 2009-01-21 20:39 UTC (permalink / raw)
  To: beginner966; +Cc: systemtap

beginner966 wrote:
> This is the declaration as given in the linux/marker.h file
> 
> /*
>  * Connect a probe to a marker.
>  * private data pointer must be a valid allocated memory address, or NULL.
>  */
> extern int marker_probe_register(const char *name, const char *format,
>                                 marker_probe_func *probe, void
> *probe_private);
> 
> /*
>  * Returns the private data given to marker_probe_register.
>  */
> extern int marker_probe_unregister(const char *name,
>         marker_probe_func *probe, void *probe_private);
> 

OK, our function declarations match up.  Good.

The error messages you sent complain about argument 3 of
marker_probe_register() and argument 2 of marker_probe_unregister().
Both of those are 'marker_probe_func *'.  So, here's my declaration of
'marker_probe_func' from linux/marker.h:

----
typedef void marker_probe_func(void *probe_private, void *call_private,

                const char *fmt, va_list *args);

----

Can you show me your declaration?

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Script with static probe point throws error in Pass 3
  2009-01-21 20:39     ` David Smith
@ 2009-01-22 13:10       ` beginner966
  2009-01-22 15:21         ` David Smith
  0 siblings, 1 reply; 8+ messages in thread
From: beginner966 @ 2009-01-22 13:10 UTC (permalink / raw)
  To: systemtap


This is the declaration present in linux/marker.h

typedef void marker_probe_func(void *probe_private, void *call_private,
                const char *fmt, ...);

Actually it was same as you mentioned, but during compilation it threw an
error:

In file included from kernel/sched.c:31:
include/linux/marker.h:33: error: expected declaration specifiers or ...
before 'va_list'

for which Frank mentioned the following:

"I don't understand this error.  Maybe it's a compiler version issue.
Different versions of marker.h use "..." in that declaration."
-- 
View this message in context: http://www.nabble.com/Script-with-static-probe-point-throws-error-in-Pass-3-tp21528274p21603765.html
Sent from the Sourceware - systemtap mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Script with static probe point throws error in Pass 3
  2009-01-22 13:10       ` beginner966
@ 2009-01-22 15:21         ` David Smith
  0 siblings, 0 replies; 8+ messages in thread
From: David Smith @ 2009-01-22 15:21 UTC (permalink / raw)
  To: beginner966; +Cc: systemtap

beginner966 wrote:
> This is the declaration present in linux/marker.h
> 
> typedef void marker_probe_func(void *probe_private, void *call_private,
>                 const char *fmt, ...);
> 
> Actually it was same as you mentioned, but during compilation it threw an
> error:
> 
> In file included from kernel/sched.c:31:
> include/linux/marker.h:33: error: expected declaration specifiers or ...
> before 'va_list'
> 
> for which Frank mentioned the following:
> 
> "I don't understand this error.  Maybe it's a compiler version issue.
> Different versions of marker.h use "..." in that declaration."

If I'm reading you correctly, originally it matched what I have (with
'va_list *args').  You changed it to '...'.

There is your problem.  Systemtap only supports the 'va_list *args'
version.  So, you need to back out your change and go back and figure
out the original compile error.

You might try including '<stdarg.h>' in marker.h.

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-01-22 14:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-18 16:40 Script with static probe point throws error in Pass 3 beginner966
2009-01-20 22:35 ` David Smith
2009-01-21 10:13   ` beginner966
2009-01-21 12:13     ` beginner966
2009-01-21 14:55     ` beginner966
2009-01-21 20:39     ` David Smith
2009-01-22 13:10       ` beginner966
2009-01-22 15:21         ` David Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).