fche changed the topic of #systemtap to: http://sourceware.org/systemtap; email systemtap@sourceware.org if answers here not timely, conversations may be logged
<kerneltoast> it's a toughie
<fche> so how does the kernel manage to service reads without comparing i_size ?
<kerneltoast> by checking for EOF maybe
<fche> yeah but how does it konw to signal EOF
<kerneltoast> hmm that'd require a buncha vfs digging
<kerneltoast> and i'm not sure the answer will help us
<fche> yeah just in case some other hack suggests itself
hpt has joined #systemtap
orivej has joined #systemtap
<fche> kerneltoast, can we call kernel_read() rather than kernel_read_file() ?
<fche> we don't need all of its kernel_security* goo checking or anything
<fche> i.e., filp_open() ... kernel_read() .... fput()
khaled has quit [Quit: Konversation terminated!]
<kerneltoast> oh hey that's exported
<kerneltoast> that could work
mjw has quit [Quit: Leaving]
<kerneltoast> still needs the STAPCONF_KERNEL_READ_FILE_FROM_PATH adjusted to STAPCONF_KERNEL_READ
<kerneltoast> and STAPCONF_KERNEL_READ_FILE_FROM_PATH_OFFSET can be dropped entirely
<kerneltoast> shall i make it so?
<kerneltoast> ah the arguments to kernel_read() are ordered differently in older kernels
<kerneltoast> why would someone do that
<kerneltoast> maybe to forcefully break old users of the function so that they notice update?
<kerneltoast> fche, btw kernel_read() goes back to pre-2.6
<kerneltoast> maybe we can dump the old hax entirely
<kerneltoast> depending on how far back the sections sysfs goes
<kerneltoast> ooooh, the sections sysfs nodes were added in 2.6.8
<kerneltoast> the module_sect_attrs stuff can be dropped completely
xlei has quit [Read error: Connection reset by peer]
khaled has joined #systemtap
fdalleau_away is now known as fdalleau
hpt has quit [Ping timeout: 240 seconds]
hpt has joined #systemtap
<fche> happen to have an ancient rhel6 box around (2.6.32) to try it agianst?
mjw has joined #systemtap
hpt has quit [Ping timeout: 248 seconds]
xlei has joined #systemtap
tromey has joined #systemtap
mjw has quit [Ping timeout: 260 seconds]
amerey has joined #systemtap
<kerneltoast> i do actually
fdalleau is now known as fdalleau_away
fdalleau_away is now known as fdalleau
<lindi-> 2.6.32? that's indeed old :)
amerey has quit [Quit: Leaving]
amerey has joined #systemtap
mjw has joined #systemtap
tromey has quit [Quit: ERC (IRC client for Emacs 27.1)]
fdalleau is now known as fdalleau_away
wcohen has quit [Remote host closed the connection]
wcohen has joined #systemtap
mjw has quit [Ping timeout: 265 seconds]
<kerneltoast> fche, sysfs symbol reads work on centos6
<kerneltoast> hurray
<kerneltoast> tested on centos6, centos8, and f33
<fche> kerneltoast, ship it my friend
<kerneltoast> hurrah
<fche> though it may be even simpler if we ditch the buffer alloc/free
<fche> and just use a little wee 30-byte thing on the stack
<kerneltoast> you fine with that?
<kerneltoast> i love stack allocs but i remember stap is paranoid about em
<kerneltoast> we could be ballsy and use 19 bytes
<fche> let's round it up a wee but yeah
<kerneltoast> 32 bytes?
<fche> sure what the heck.
<kerneltoast> almighty power of 2
<fche> phear me
<fche> a little bit
<kerneltoast> fche, you wanna trust that kernel_read() will terminate our buffer?
<kerneltoast> or i can zero it
<kerneltoast> or i can parse the returned len from kernel_read() and set the last byte to 0
<fche> yes, that
<fche> kstrtoul doesn't take the length, slacker
<kerneltoast> yea but how ballsy do we wanna be
<kerneltoast> this is very importante performance 0ptimizat0nz
<kerneltoast> i guess i'll just zero on the stack
<fche> suggest buf[len] = '\0'
<fche> yea
irker879 has joined #systemtap
<irker879> systemtap: sultan systemtap.git:master * release-4.4-135-g104cf26b4 / buildrun.cxx runtime/linux/autoconf-kernel_read-new-args.c runtime/linux/autoconf-kernel_read_file_from_path-offset.c runtime/transport/symbols.c: Always get section info via sysfs using kernel_read()