fche changed the topic of #systemtap to: http://sourceware.org/systemtap; email systemtap@sourceware.org if answers here not timely, conversations may be logged
zodbot has joined #systemtap
hpt has joined #systemtap
darvon has quit [Ping timeout: 250 seconds]
darvon has joined #systemtap
irker305 has quit [Quit: transmission timeout]
zw01 has quit [Quit: Leaving]
zw01 has joined #systemtap
ravi has joined #systemtap
nkambo1 has joined #systemtap
nkambo has quit [Ping timeout: 248 seconds]
ravi has quit [Remote host closed the connection]
hpt has quit [Ping timeout: 260 seconds]
ego has joined #systemtap
ego has quit [Ping timeout: 276 seconds]
ego has joined #systemtap
srikar_away is now known as srikar
scox has quit [Ping timeout: 264 seconds]
ego has quit [Ping timeout: 244 seconds]
wcohen has quit [Ping timeout: 260 seconds]
scox has joined #systemtap
srikar is now known as srikar_away
drsmith has joined #systemtap
mbenitez has joined #systemtap
brolley has joined #systemtap
wcohen has joined #systemtap
tromey has joined #systemtap
mbenitez has quit [Ping timeout: 276 seconds]
mbenitez has joined #systemtap
cdleonard has joined #systemtap
cdleonard has left #systemtap [#systemtap]
jemarch has quit [Ping timeout: 248 seconds]
ppetraki has joined #systemtap
srikar_a` has joined #systemtap
srikar_away has quit [Ping timeout: 276 seconds]
srikar_away has joined #systemtap
srikar has quit [Ping timeout: 276 seconds]
srikar_away is now known as srikar
modem has quit [Ping timeout: 248 seconds]
modem has joined #systemtap
modem has quit [Ping timeout: 248 seconds]
srikar is now known as srikar_away
mjw has quit [Quit: Leaving]
modem has joined #systemtap
irker560 has joined #systemtap
<irker560>
systemtap: dsmith systemtap.git:refs/heads/master * release-3.0-18-g67533af / tapset/linux/syscalls2.stp testsuite/systemtap.syscall/preadv.c testsuite/systemtap.syscall/pwritev.c: Improve 64-bit file offset handling in syscall.preadv and syscall.pwritev. http://tinyurl.com/gv5zzmf
mjw has joined #systemtap
<irker560>
systemtap: dsmith systemtap.git:refs/heads/master * release-3.0-19-g67004c5 / tapset/linux/aux_syscalls.stp tapset/linux/nd_syscalls2.stp tapset/linux/syscalls2.stp testsuite/systemtap.syscall/preadv.c testsuite/systemtap.syscall/pwritev.c: Fix PR19905 by adding support for the preadv2/pwritev2 syscalls. http://tinyurl.com/zxfoujj
wcohen has quit [Remote host closed the connection]
wcohen has joined #systemtap
litb has joined #systemtap
<litb>
hello all
<litb>
is it possible to print std::string, std::vector and friends with systemtap?
<litb>
i.e instead of printing the aggregation structure, print the actual payload?
<fche>
we could use some library functions for that - kind of like the python pretty-printers gdb uses
<fche>
jistone, hm... maybe we could use overloaded functions in the runtime for prettyprinting funky types
<fche>
function prettyprint:string(ptr,type_string) { if (type_string=="std::string....") { .. } else { next } } ??
<fche>
and have the $$ expansion call into those?
<jistone>
why do it at runtime (overloaded function) when that type_string is statically known?
<jistone>
(also, fwiw, it will likely be "std::basic_string<blah blah blah>")
<fche>
(that's an optimization!)
<fche>
ie. avoid hard-coding it within the translator
<fche>
instead let the tapset - expandable! - handle it
<fche>
that could be an avenue for hooking in foreign-language values too
<jistone>
(feels like you're dismissing an architectural question as optimization out of hand)
<fche>
I agree as much should be compile-time as possible
<fche>
and I also think as much should be expandable (not elaborate.cxx c++) as possible
<jistone>
the pretty-printer has to know the type to pass around .. how extensible can this really be?
<fche>
the $$ expansion code in the translator could call the pretty-printer function with the type name string
<fche>
ie make that part of the 'abi' so to speak
<fche>
and as for static compilation ...
<jistone>
right, but if you know the type name string, you already have info about the language
<fche>
but the translator would need to know nothing but the type name (out of dwarf)
<fche>
and re static compilation, just to finish the thought ...
<litb>
can i write such a function today with custom .stp files?
<jistone>
-> stap pass-2 plugins?
<fche>
an optimization pass that 'de-virtualizes' or de-overloads various alternative functions based upon a pattern of usage (look for PARAM2 ~= REGEX e.g.) and evaluate it at compile time ... bob's your uncle
<litb>
i could write a "mapping" c struct and @cast the std::string pointer to it, as long as the c struct has the same memory layout. then i could walk along the pointers to reach the stored char[]
<jistone>
litb, if you know you have a std::string in hand, you could print however you like. there's just no way to hook into pretty-printing as fche is suggesting
<litb>
for the case that the library has no complete debug information
<fche>
litb, you can do so today, sort of: $str->_m->buf$ or somesuch
<litb>
jistone: ah i see. is the "mapping" c struct a good idea?
<litb>
if we have no debug information, like with libQtCore*.so ?
<fche>
where is your probe ? how are you getting hold of a context data value?
<litb>
it's a QString i'm actually worrying about, which has this stupid d pointer whose pointee type is only defined in the qstring.cpp file
<fche>
dwarf needs the declaration rather than definition of the type (to be pedantic); so the caller binary may well have enough
<fche>
if it's not an opaque type
<litb>
fche: i'm planning to write .function("foo") probes and access the parameters using $bar
<fche>
yes what.function though? library or your binary ?
<fche>
as in which "what." ?
<litb>
fche: well the type is only forward declared like class QStringPrivate; or something
<litb>
and my system's libQtCore*so has no debug information to account for the missing fields information
<jistone>
if you can get to headers, @cast($foo, "QStringPrivate", "<qstring-impl.h>")
<litb>
jistone: ah so if i'm doing remote (ssh) userspace stap, and the remote machine runs non-debug binaries, and my local dev machine has the debug binary with the symbols and field names, I can use that binary with @cast ?
<litb>
i imagine i could then also compile my own qt with debug symbols, and without relinking existing qt apps (they still use the release version), i could access QString objects
<jistone>
yes to all, but you need to be careful that you've really matched ABI
<litb>
i see
mbenitez has quit [Quit: Leaving]
drsmith has left #systemtap [#systemtap]
<litb>
jistone: does it have to compile for the compiler to generate the DWARF? or can it cause an error and it still can generate the dwarf info?
<litb>
i imagine, that generating the dwarf info is much simplier than generating a fully working object file, so I wonder whether a debuginfo-only compile suffices and whether it's possible
<jistone>
litb, for this we only care about debuginfo type layout, not any object code. but I don't know any way to compiler *just* that debuginfo
<jistone>
(there are tools to strip debuginfo into separate files, but I think that's different than what you're asking)