fche changed the topic of #systemtap to: http://sourceware.org/systemtap; email systemtap@sourceware.org if answers here not timely, conversations may be logged
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #systemtap
orivej has quit [Ping timeout: 260 seconds]
invano has quit [Ping timeout: 240 seconds]
invano has joined #systemtap
orivej has joined #systemtap
brolley has joined #systemtap
tromey has joined #systemtap
<agentzh> fche: are you okay with adding new stap options -Wno-unused-variable and -Wno-unused-function to suppress those "Eliding unused ..." warnings?
<agentzh> or maybe just -Wunused ?
<agentzh> sorry, should be -Wno-unused
<agentzh> for auto-generated stap scripts, such warnings are just too many...
<agentzh> so it would be great to have a way to silence them all.
<agentzh> similarly, we could also have the -Wno-side-effect-free option to silence those "side-effect-free expression" and "side-effect-free function" warnings from the stap translator?
<fche> agentzh, is -W too blunt for your purposes?
<fche> are there any warnings you want to see for your generator's output ?
tromey has quit [Quit: ERC (IRC client for Emacs 26.1.50)]
brolley has left #systemtap [#systemtap]
<agentzh> fche: those warnings are usually helpful when developing the tools. but for production use, we do not want to see them again.
<fche> ok I meant what about "stap -w" ?
<agentzh> what does it do?
<fche> -w Suppressed warnings mode. Disables all warning messages.
<agentzh> oh, i see, it's already there.
<agentzh> yeah, too overkill for our purposes.
<fche> so the question is what warnings are included in that which you need to see
<agentzh> yeah, just like the granularity control in gcc, for example.
<agentzh> gcc also has -Wno-unused-function and -Wno-unused-variable, in addition to -Wno-unused. i won't mind if we can have them all :)
<agentzh> stap does not have -Wunused-parameter, does it? ;)
<fche> no, just plain -w
<agentzh> i mean warnings for unused function parameters.
<fche> not sure
<agentzh> never seen it myself anyway :)
<fche> anyway, if you're sure you need a more cosmetic warning suppression option, I can suggest something that's not a pandora's box of future options
<agentzh> for example?
<agentzh> any suggestions?
<agentzh> you are not happy with gcc's option names?
<fche> a -w-suppress SUBSTRING or REGEX wherein systemtap_session::print_warning can match against the incoming message_str and filter based on a set of matches
<agentzh> i would go for -Wno-xxx to be consistent with gcc's CLI, but i understand it does not have to be the same as gcc.
<fche> i.e., not to overcomplicate the command line option parsing machinery
<agentzh> ah, that's quite flexible.
<agentzh> SUBSTRING should be good enough.
<agentzh> REGEX is a bit overkill for this purpose.
<fche> yeah probably
<agentzh> okay, we'll go this way then.
<fche> one downside is i18n stuff ... ::print_warning gets the translated form of messages methinks
<agentzh> it sounds easier to implement with extra flexibility.
<fche> but as long as you're using in a single language environment, that should be okay
<agentzh> oh, the i18n stuff.
<agentzh> i think we could only match against the msg id, which is English?
<fche> ::print_warning doesn't see a message 'id', it sees a string
<agentzh> alas. a bit too late in timing.
<fche> but maybe good enough for your development-time purposes
<agentzh> yeah, good enough even for production use.
<agentzh> we could always enforce LC_ALL=C anyway.
<fche> or for production production, use -w
<agentzh> as long as you are okay with that.
<agentzh> we do not want to filter out all warnings in production either. just those we know about.
<agentzh> we'll work on a patch for --w-suppress then.
<agentzh> is it --w-suppress or -w-suppress ?
<agentzh> double dashes look better to me.
<fche> yeah, or --no-w SUBSTRING
<fche> think of something tasteful, it's easy to tweak during review anyway
<agentzh> i like --no-w more :)
<agentzh> less typing. yay
<fche> heh, put it into your $HOME/.systemtap/rc, and never have to type it again
<agentzh> well, still need to tune it on a case by case basis :)
<agentzh> especially when hacking on stap itself.
<agentzh> fche: we are already working on the floating-point number support in stap.
<agentzh> the current plan is to use long to store a double.
<agentzh> and use NaN tagging to store a float.
<agentzh> not ideal for 32-bit kernels though but the changes would be minimal to get this working on 64-bit kernels.
<agentzh> ideally we should introduce native float and double types in both the type system and the kernel-space runtime, but that would be a huge change.
<agentzh> we'd rather keep the changeset minimal at this point.
<agentzh> stap definitely needs more fine-grained integer types too :)
<agentzh> a single long type really sucks and we have to accommondate that in our higher level language compiler.
<fche> maybe ... simplicity has been attractive
<fche> anyway, as with any other serious change, would love to see a problem statement, examples, an outline of the solution, that kind of thing
<agentzh> sure.
<agentzh> the thing is that it's often the case that the target process is written in C/C++ and to traverse the data structure in the target process, one usually has to port existing traversal code in the target C/C++ program over to stap. and the type system mismatch creates too many pitfalls that are so difficult to get exactly right.
<agentzh> that's one of the motivatins of our c2stap compiler. another motivation is to avoid writing tools for multiple different debugging platforms over and over again (like stap, gdb, lldb, bcc, and etc).
<agentzh> we've been pushing the limit of stap in our own uses of stap.
<agentzh> gdb python succeeds in that it keeps the full type system and their aritmetic rules at runtime though one still has to take care of C's own implicit type conversion rules himself (like integer promotion and etc).
<fche> I must say your c2stap effort feels quixotic -- but am happy to consider related stap improvements that don't undermine its overall feel or security.
<agentzh> fche: well, that's just automating what we've been doing manually for years.
<agentzh> and the stap backend of our compiler has already been passing most of the tests in our test suite (the gdb py backend has passed them all).
<agentzh> so it's not that quixotic as it sounds :)
<fche> wild
<agentzh> after hacking floating-point numbers, variable-aware usymdata() tapset function, and non-null-terminated string types into stap, our ylang compiler's stap backend can pass all of the tests.
<agentzh> after that, we'll work on a dwarf-less stap backend for our ylang compiler.
<agentzh> and then the bcc backend or just help improving stap's bpf runtime instead. not decided yet.
<agentzh> both bcc and stap's bpf runtime look primitive and immature.
<fche> kernel bpf is kind of primitive (by design)
<agentzh> *nod*
<agentzh> so we're considering a custom bpf runtime as a custom kernel C module.
<fche> and getting that integrated into the kernel proper?
<agentzh> not holding my breathe for that.
<agentzh> you do know those kernel folks ;)
<agentzh> it can be much more political and subjective than technical.
<fche> so I hear :)
<fche> but OTOH if merging it upstream is not on the table, then why bother? as opposed to compiling straight to c a la systemtap classic?
<agentzh> well, we could give it a shot :)
<agentzh> just not be hopeful.
<agentzh> we might also port it over to other operating systems as well.
<agentzh> just play as we go :)
<agentzh> fche: btw, i do not believe in a single unified debugging framework. i believe in targeting different debugging toolchains as we see fit. the latter is much more practical. for example, stap cannot be used to debug core dump files (yet), nor can it be used on other operating systems without virtualing a linux.'
<agentzh> *virtualizing
<agentzh> so abstraction can be really powerful here.
<agentzh> our ylang is such an abstraction.
<agentzh> it is also not just a single language (a superset of C). we're planning to add more language frontents to it atop the existing C frontend. for example, we can use python when debugging python apps, use lua for lua apps, php for php apps, and etc.
<agentzh> the possibilities are unlimited.
<agentzh> just build up the abstractions and let optimizing compilers emit fast debugging tool code.
<agentzh> stap is great in that it has multiple backens (kernel, dyninst, bpf), but the frontend is a bit too limited.
<agentzh> but i do understand of being minimalistic and simplistic.
<agentzh> *do understand the intention of
<fche> it's for humans to write code in, not compilers
<agentzh> so in our ylang compiler, stap is just a vm and a backend :)
<fche> have you published anything about ylang?
<agentzh> humans already write much code, and for debugging, we just move the existing C code (or other languages' code) over :)
<agentzh> instead of writing it from scratch again.
<agentzh> re published anything about ylang: not yet.
<fche> ok
<agentzh> the target programs already know how to digest and traverse their own data structures.
<agentzh> so it's wasteful if we have to redo that for stap/gdb/etc tools.
<agentzh> and risk introducing bugs in our own stap/gdb py code.
<agentzh> not to mention the burden of maintaining the code as the target programs evolve.
<agentzh> it looks very natural to simply reuse what we already have :)