udp.sendmsg
David Smith
dsmith@redhat.com
Thu Aug 25 19:52:00 GMT 2016
On 08/25/2016 11:18 AM, webman@manfbraun.de wrote:
> Hello !
>
> Many thanks for your answer!
> Sometimes, writing "it's not working" reactivates some areas
> in the own brain, do dig deeper ...
> What ist failing for me, is my modified version of the original
> script. I run the original and no errors at all ... ;-)
>
> So, here is MY version - with my little newbies thinking about
> this type of scripts ;-)
>
> =======================
> probe begin { printf("Monitoring use of port 53\n") }
> probe end { printf("Stopped.\n") }
>
> probe udp.sendmsg {
> if ( dport == 53 ) {
> task = pid2task(pid());
> printf(
> "UDP53 %5d.%6d %15s %d(%s/%s) %d(%s)\n",
> gettimeofday_s(),
> gettimeofday_ms(),
> daddr,
> pid(),
> task_execname(task),
> execname(),
> ppid(),
> pexecname()
> )
> }
> }
OK, here's a couple of things about your script.
task = pid2task(pid())
is the same thing as:
task = task_current()
Plus, since task is the current task, task_execname(task) and execname()
are always going to return the same string.
So, at that point you really don't need your 'task' variable.
If you are still getting that kernel_string copy fault error, you'll
need to delete/replace one function call at a time so that we can narrow
down which function is causing the fault.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
More information about the Systemtap
mailing list