public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/5956] New: Usage of "NULL" in systemtap script throws non-apparent error messages
@ 2008-03-18 12:08 srinivasa at in dot ibm dot com
  2008-03-18 13:08 ` [Bug translator/5956] " fche at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: srinivasa at in dot ibm dot com @ 2008-03-18 12:08 UTC (permalink / raw)
  To: systemtap

Environment: 2.6.24 kernel, systemtap 20080315 snapshot and elfutils-0.130

If I use "NULL" in systemtap scripts, stap throws non-apparent error messages.
Systemtap user finds it difficult to understand these error messages. So there
is a need for more obvious/apparent error message for this situation.


=======================================================
[root@llm27lp1 obj]# cat b.stp
        global array

        probe syscall.write {
                if ($buf != NULL)
                array[pid()]++;
        }
        ....................
        .....................
======================================
Pass 3: translated to C into
"/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c" in 0usr/0sys/2real ms.
Running make -C "/lib/modules/2.6.24/build" M="/tmp/stapAyIw1G" modules >/dev/null
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:92: error: expected
identifier or '(' before 'void'
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:92: error: expected
')' before numeric constant
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:93: error: expected
';' before 'union'
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c: In function
'probe_1109':
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:237: error: expected
identifier before '(' token
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:259: error: expected
identifier before '(' token
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:268: error: 'struct
probe_1109_locals' has no member named '__tmp0'
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:273: error: 'struct
probe_1109_locals' has no member named '__tmp2'
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:273: error: 'struct
probe_1109_locals' has no member named '__tmp0'
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:274: error: 'struct
probe_1109_locals' has no member named '__tmp3'
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:274: error: 'struct
probe_1109_locals' has no member named '__tmp2'
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:275: error: 'struct
probe_1109_locals' has no member named '__tmp2'
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:276: error: 'struct
probe_1109_locals' has no member named '__tmp0'
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:276: error: 'struct
probe_1109_locals' has no member named '__tmp2'
/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.c:277: error: 'struct
probe_1109_locals' has no member named '__tmp3'
make[1]: *** [/tmp/stapAyIw1G/stap_7513fe211e17b3d61924ad9133f1d1e1_857.o] Error 1
make: *** [_module_/tmp/stapAyIw1G] Error 2
==================================================

-- 
           Summary: Usage of "NULL" in systemtap script throws non-apparent
                    error messages
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: srinivasa at in dot ibm dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=5956

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug translator/5956] Usage of "NULL" in systemtap script throws non-apparent error messages
  2008-03-18 12:08 [Bug translator/5956] New: Usage of "NULL" in systemtap script throws non-apparent error messages srinivasa at in dot ibm dot com
@ 2008-03-18 13:08 ` fche at redhat dot com
  2008-03-20 19:36 ` fche at redhat dot com
  2008-04-30 22:47 ` fche at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: fche at redhat dot com @ 2008-03-18 13:08 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2008-03-18 13:08 -------
The NULL name is being treated as an implicitly declared systemtap local,
and is copied into the generated C code's context structure.  These names
should be prefixed with something too, just like the globals already are
(s_VAR).  See translate.cxx: var::value() and c_varname().

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=5956

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug translator/5956] Usage of "NULL" in systemtap script throws non-apparent error messages
  2008-03-18 12:08 [Bug translator/5956] New: Usage of "NULL" in systemtap script throws non-apparent error messages srinivasa at in dot ibm dot com
  2008-03-18 13:08 ` [Bug translator/5956] " fche at redhat dot com
@ 2008-03-20 19:36 ` fche at redhat dot com
  2008-04-30 22:47 ` fche at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: fche at redhat dot com @ 2008-03-20 19:36 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2008-03-20 19:35 -------
Rather than tweak the local variable naming widget, which has the potential
of changing the embedded-c function API, I committed a patch that defines
a NULL systemtap-level global.  This works because globals do have a C-level
name prefixing to avoid conflict with kernel globals/macros.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


http://sourceware.org/bugzilla/show_bug.cgi?id=5956

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug translator/5956] Usage of "NULL" in systemtap script throws non-apparent error messages
  2008-03-18 12:08 [Bug translator/5956] New: Usage of "NULL" in systemtap script throws non-apparent error messages srinivasa at in dot ibm dot com
  2008-03-18 13:08 ` [Bug translator/5956] " fche at redhat dot com
  2008-03-20 19:36 ` fche at redhat dot com
@ 2008-04-30 22:47 ` fche at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: fche at redhat dot com @ 2008-04-30 22:47 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2008-04-30 21:13 -------
patch committed

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=5956

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

end of thread, other threads:[~2008-04-30 21:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-18 12:08 [Bug translator/5956] New: Usage of "NULL" in systemtap script throws non-apparent error messages srinivasa at in dot ibm dot com
2008-03-18 13:08 ` [Bug translator/5956] " fche at redhat dot com
2008-03-20 19:36 ` fche at redhat dot com
2008-04-30 22:47 ` fche at redhat dot com

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).