public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: David Smith <dsmith@redhat.com>
To: webman@manfbraun.de, "'Frank Ch. Eigler'" <fche@redhat.com>
Cc: systemtap@sourceware.org
Subject: Re: udp.sendmsg
Date: Thu, 25 Aug 2016 19:52:00 -0000	[thread overview]
Message-ID: <f0b3fbe9-1100-c7d6-35b7-9b92157f6202@redhat.com> (raw)
In-Reply-To: <!&!AAAAAAAAAAAYAAAAAAAAAOosgHnoPqdNlUO2DUrQ/DfCgAAAEAAAALedYE8qwt9NnQcEwtaCu08BAAAAAA==@manfbraun.de>

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)

  reply	other threads:[~2016-08-25 19:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-10 20:58 udp.sendmsg webman
2016-07-11 10:09 ` udp.sendmsg Timo Juhani Lindfors
2016-07-19 14:41 ` udp.sendmsg Frank Ch. Eigler
2016-08-19  2:18   ` udp.sendmsg webman
2016-08-19 16:32     ` udp.sendmsg David Smith
2016-08-25 16:19       ` udp.sendmsg webman
2016-08-25 19:52         ` David Smith [this message]
2016-08-25 19:59           ` udp.sendmsg Frank Ch. Eigler
2016-09-03 14:31           ` udp.sendmsg webman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f0b3fbe9-1100-c7d6-35b7-9b92157f6202@redhat.com \
    --to=dsmith@redhat.com \
    --cc=fche@redhat.com \
    --cc=systemtap@sourceware.org \
    --cc=webman@manfbraun.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).