fche changed the topic of #systemtap to: http://sourceware.org/systemtap; email systemtap@sourceware.org if answers here not timely, conversations may be logged
azhang has quit [Ping timeout: 244 seconds]
sapatel has quit [Remote host closed the connection]
sscox has joined #systemtap
orivej has quit [Ping timeout: 260 seconds]
orivej has joined #systemtap
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #systemtap
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #systemtap
wcohen has quit [Remote host closed the connection]
wcohen has joined #systemtap
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #systemtap
hpt has joined #systemtap
orivej has quit [Ping timeout: 260 seconds]
orivej_ has joined #systemtap
orivej_ has quit [Ping timeout: 240 seconds]
orivej has joined #systemtap
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #systemtap
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #systemtap
orivej has quit [Ping timeout: 260 seconds]
orivej has joined #systemtap
_whitelogger has joined #systemtap
orivej has quit [Ping timeout: 240 seconds]
derek088_ has joined #systemtap
derek088_ has quit [Ping timeout: 260 seconds]
sscox has quit [Ping timeout: 244 seconds]
sscox has joined #systemtap
khaled has joined #systemtap
orivej has joined #systemtap
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #systemtap
derek088_ has joined #systemtap
azhang has joined #systemtap
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #systemtap
derek088_ has quit [Ping timeout: 244 seconds]
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #systemtap
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #systemtap
orivej has quit [Ping timeout: 260 seconds]
orivej has joined #systemtap
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #systemtap
mjw has joined #systemtap
orivej has quit [Ping timeout: 244 seconds]
orivej has joined #systemtap
hpt has quit [Ping timeout: 265 seconds]
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #systemtap
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #systemtap
hpt has joined #systemtap
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #systemtap
orivej has quit [Ping timeout: 244 seconds]
orivej has joined #systemtap
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #systemtap
orivej has quit [Read error: Connection reset by peer]
hpt has quit [Ping timeout: 265 seconds]
orivej has joined #systemtap
orivej has quit [Ping timeout: 256 seconds]
zhuizhuhaomeng has joined #systemtap
zhuizhuhaomeng has quit [Client Quit]
zhuizhuhaomeng has joined #systemtap
tromey has joined #systemtap
amerey has joined #systemtap
orivej has joined #systemtap
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #systemtap
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #systemtap
jhg_ has quit [Ping timeout: 256 seconds]
jhg_ has joined #systemtap
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #systemtap
axel12 has joined #systemtap
zhuizhuhaomeng has quit [Ping timeout: 244 seconds]
<axel12> So I tried installing systemtap on ubuntu 20.04. Did not work out. So I did a lot of things nothing helped. Followed your wiki article https://sourceware.org/systemtap/wiki/SystemtapOnUbuntu
<axel12> I can run the helloworld script. Tho I get the following warning:
<axel12> WARNING: Kernel function symbol table missing [man warning::symbols]
<axel12> Looked in the man page ran the suggested command from that man page
<axel12> Running stap -l 'module("*").function("*")' results in no output. Does anybody have an idea on how to install systemtap on ubuntu 20.04 or where to find infos about it
<amerey> axel12, if the helloworld script is working, then it should be installed. you could try running stap-prep to install various kernel debug files needed for some probes
<axel12> Ran that changed nothing :(
orivej has quit [Ping timeout: 240 seconds]
zhuizhuhaomeng has joined #systemtap
orivej has joined #systemtap
<axel12> Yes it is installed but I am using stap -l 'module("*").function("*")' as an indicator on whether or not it runs correctly and that outputs nothing
<amerey> does the command terminate with no output or hang for a long time? that probe will take a while to compile
<amerey> you could try a simpler probe, ex. stap -l 'syscall.read'
<axel12> Terminates with the following output
<axel12> alex@alex:~$ stap -l 'syscall.read'Tip: /usr/share/doc/systemtap/README.Debian should help you get started.
<fche2> axel12, dies #stap-prep help you?
<fche2> (does)
<axel12> no ran that
<axel12> terminated without output
<fche2> by the way, what does stap -V say?
<axel12> stap -V
<axel12> alex@alex:~$ stap -V Systemtap translator/driver (version 4.2/0.176, Debian version 4.2-3)Copyright (C) 2005-2019 Red Hat, Inc. and othersThis is free software; see the source for copying conditions.tested kernel versions: 2.6.32 ... 5.4-rc6enabled features: AVAHI BPF LIBSQLITE3 NLS NSS
<axel12> alex@alex:~$ uname -r5.4.0-42-generic
<fche2> ok, good to know, so it's a little old and not git master and doesn't have elfutils 0.178+, so can't use our debuginfo server
fche2 is now known as fche
<fche> amerey, can you remind me whether you had some luck setting up a ubuntu ppa with newer elfutils?
<amerey> fche, no it hasn't been set up
<fche> ok
<ema> amerey: what if you run the command as root?
<ema> ah, sorry, the above was meant for axel12 ^
<fche> axel12, if you can build/install a new version of elfutils in a private directory, and configure systemtap to use that via LD_LIBRARY_PATH,
<axel12> I was wondering already
<fche> then you can use our public debuginfo server, which lets systemtap download linux-image-unsigned-5.4.0-42-generic-dbgsym_5.4.0-42.46_amd64.ddeb in this case
<fche> maybe we should add those instructions into the wiki
<axel12> That works :D
<amerey> axel12, ok it may work without sudo if you add yourself to the stapusr, stapdev and stapsys groups
<axel12> i think i did that lemme check
<ema> as mentioned in /usr/share/doc/systemtap/README.Debian :)
<axel12> alex@alex:~$ groupsalex adm cdrom sudo dip plugdev lxd stapdev stapusr stapsys
<amerey> hmm ok
<axel12> So I am gonna build ELFUTILS now ?
<fche> if what you have works if you invoke stap as root, then nah, leave it alone
<fche> (I mean you can but you don't have to)
<fche> serhei, we should probably get hold of a ubuntu 20.04 lts
<fche> on one of our buildbots
zhuizhuhaomeng has quit [Remote host closed the connection]
zhuizhuhaomeng has joined #systemtap
derek0883 has joined #systemtap
<axel12> So it kinda works right, but when I run:
<axel12> root@alex:/home/alex# stap -L 'kernel.function("vfs_read")'kernel.function("vfs_read@/build/linux-kcrkKx/linux-5.4.0/fs/read_write.c:446")
<axel12> It is missing the part with the variables. So that means I am missing the debug symbols?
<fche> hm without the symbols you wouldn't have the source path / line number
orivej has quit [Ping timeout: 240 seconds]
<axel12> I mean I got the packages
<axel12> root@alex:/home/alex# sudo apt list --installed | grep `uname -r`WARNING: apt does not have a stable CLI interface. Use with caution in scripts.linux-headers-5.4.0-42-generic/focal-updates,focal-security,now 5.4.0-42.46 amd64 [installed]linux-image-5.4.0-42-generic-dbgsym/focal-updates,focal-proposed,now 5.4.0-42.46 amd64
<axel12> [installed]linux-image-5.4.0-42-generic/focal-updates,focal-security,now 5.4.0-42.46 amd64 [installed,automatic]linux-image-unsigned-5.4.0-42-generic-dbgsym/focal-updates,focal-proposed,now 5.4.0-42.46 amd64 [installed,automatic]linux-modules-5.4.0-42-generic/focal-updates,focal-security,now 5.4.0-42.46 amd64
<axel12> [installed,automatic]linux-modules-extra-5.4.0-42-generic/focal-updates,focal-security,now 5.4.0-42.46 amd64 [installed,automatic]
<fche> what about # stap -L 'kernel.function("do_exit")' ?
<axel12> That shows one
<axel12> root@alex:/home/alex# stap -L 'kernel.function("do_exit")' kernel.function("do_exit@/build/linux-kcrkKx/linux-5.4.0/kernel/exit.c:711") $code:long int
orivej has joined #systemtap
<fche> ok, so probably you are generally fine. Time to try an actual script?
<axel12> I mean I tried some and generally works. But I am planing to write embedded C code:b which is a pretty bad idea because I am a noob but whatever. I wanna get the control group (or groups) of the from "current". Wanna check if the process runs in a docker container :D. I looked at the kernel source code and I got a rough idea. Just wanna make sure
<axel12> it fails cause of my noobiness and because it is broken or wrongly installed XD
<fche> well, run it inside a VM in case the C code is not quite right :)
<fche> but see also function::task_ns_egid and associated bits
<fche> we already have -some- namespace-aware lookup functions
derek0883 has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 256 seconds]
orivej_ has joined #systemtap
<axel12> Yes of cause I used a vm :D I ran my stupid script and it might actually work. Prints out / as cgroup now which I think is fine because I have nothing special running. Gonna try again wehen starting docker conatiner
<fche> there you go
<axel12> *of course
axel12 has quit [Remote host closed the connection]
axel12 has joined #systemtap
<axel12> Wow it actually works :D
<fche> well of course it works :-) :-) :-)
<axel12> Wanna see by fucked up code? Then u might now why id did not expect it to
<axel12> I might contribute my code if u want me to. Tho u probably need to tell me how to rewrite my code properly.:') And ure probably faster doing it yourself then. But being able to get the cgroup of a process is pretty nice feature. Especially cause it allows you to see what process is in what docker conatiner. I can even build a function
<axel12> docker_conatiner_id():]
<fche> yup, the cgroup name(s) would be handy
<fche> so yeah sure would be interesting to see
<axel12> Can u advise me an IRC client where it stores messages while I am away etc. Does that exist?
<axel12> That's my proof of concept:
<axel12> %{#include <linux/sched.h>#include <linux/list.h>#include <linux/kernfs.h>#include <linux/cgroup-defs.h>%}probe begin{ print ("Starting...\n")}probe nd_syscall.* { if(target() != pid()) next printf("%d;%s\n", pid(), getCgroup())}function getCgroup:string()%{ struct task_struct *currently_observed_task = current;
<axel12> char fileName[200]; struct css_set *cgroups = currently_observed_task->cgroups; struct cgroup_subsys_state **subsys = cgroups->subsys; struct cgroup_subsys_state *firstSubsys = subsys[0]; struct cgroup *cgroup = firstSubsys->cgroup; struct kernfs_node *kn = cgroup->kn; int result = kernfs_path_from_node(kn,
<axel12> NULL, fileName, 200*sizeof(char)); if (result < 0) STAP_ERROR ("cannot resolve cgroup"); snprintf(STAP_RETVALUE, 200, "%s", fileName);%}
<axel12> IRC is definetly not good to paste code
<fche> yeah, no
<fche> pastebin or something
<axel12> Does anybody know if i need to aquire some lock for such a read. Says so in the kernel docs I should for operations in blabla blub but I mean I am only logging it what could go wrong :')
<fche> hm kernfs_path_from_node could write straight into the STAP_RETVALUE, eliminating one copy
<fche> as to locking .... not sure, depends on the cgroups / kernfs subsystems. you'd have to know whether any of those things can change for a task while one of tehse probes is running (on another cpu/thread e.g.)
<axel12> Probably could change I am gonna read into how this RCU thing works
<fche> heh
<fche> I'd look at how other parts of the kernel traverse the subsys[] bits and call kernfs_*
<axel12> Actually when thinking about it. The kernfs_path_from_node acquired some kind of lock, but need to check that.
<axel12> I mean there is some way to acquire a lock on the cgroup as well but I think if kernfs_path_from_node is thread safe that probably is not even needed
orivej_ has quit [Ping timeout: 240 seconds]
orivej has joined #systemtap
orivej has quit [Ping timeout: 246 seconds]
orivej_ has joined #systemtap
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #systemtap
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #systemtap
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #systemtap
orivej has quit [Ping timeout: 264 seconds]
orivej has joined #systemtap
tromey has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #systemtap
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #systemtap
axel12 has quit [Remote host closed the connection]
mjw has quit [Read error: Connection reset by peer]
amerey has quit [Quit: Leaving]
sapatel has joined #systemtap
sapatel has quit [Client Quit]
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #systemtap
sscox has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #systemtap