All of lore.kernel.org
 help / color / mirror / Atom feed
From: cwarlich@gmx.de (Christof Warlich)
To: kernelnewbies@lists.kernelnewbies.org
Subject: ftrace events: parameter tracing
Date: Wed, 14 Feb 2018 21:47:18 +0100	[thread overview]
Message-ID: <2bde6ec0-b4d0-1447-4380-eb51375df5be@gmx.de> (raw)
In-Reply-To: <48396.1518637408@turing-police.cc.vt.edu>

Am 14.02.2018 um 20:43 schrieb valdis.kletnieks at vt.edu:

> Doesn't "make" already do what you want?
No, make itself cannot generate dependency lists on its own, it needs 
tooling like gcc -MD ... to do that. I'm interested in a generic 
approach. But it my read and thus obey them.
> Oh, wait...
>
>> dependency recording, because the "results" of running "ls -l" do depend
>> on its shared libraries!
> This way lies madness - touch glibc or other package like that, and you just forced
> a rebuild of the entire world.  In fact, I suspect that trying to follow "dependencies"
> to that level will result in build times close to what a 'make world' would do, because
> computing what ends up being the transitive closure of all file references is painful.
>
> Hint:  To really do this correctly, you need to be able to force 100% code path
> coverage - otherwise you won't pick up the fact that /usr/lib64/libsnark.so is only
> actually used in an error path or similar rare-access corner case.
Well, unwanted dependencies could be excluded by a blacklist, although I 
still believe that at least /_most_/ of the required shared libraries 
should rightfully be kept as dependencies, last but not least because 
libraries are changed occasionally only on a build server, making world 
builds rare as well.
> For bonus points:
>
> openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_MONETARY", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_MONETARY", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_TIME", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_TIME", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_NUMERIC", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_NUMERIC", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = 3
>
> Which file(s) count?  How do you test for all values of $LANG and the various LC_*
> environment variables?
>
> There's a reason that most sane software builds and tools like rpm / dpkg and
> so on just check "glibc is still version 2.22" and don't bother going any
> further than that.
>
> And it just gets worse if you include kernel patches - how many modules end up
> involved in an open() call on a USB device?  How do you detect that your code
> "depends" on a given behavior - often kernel patches address error conditions
> that doesn't change the perceived behavior in your userspace program...
>
> ... until a rare error condition arises.  At this point, you need 100% code coverage
> of both the userspace *and* the kernel.
I'm not so sure whether full coverage is really necessary. Instead, the 
depencency record of a full succesful initial build might be sufficient. 
Even considering other influencing things like the environment should be 
possible.
> To quote the movie Animal House: "My advice to you is to start drinking heavily....."
You are most probably right with that, but I'd still like to continue 
pondering ... - as long as there is a way to yield the filename of an 
opened file using (fast) ftrace instead of slow ptrace?

Thus, I'd still be interested in a solution or hint to my initial question.
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180214/2999651c/attachment.html>

  reply	other threads:[~2018-02-14 20:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 18:39 ftrace events: parameter tracing Christof Warlich
2018-02-14 18:47 ` valdis.kletnieks at vt.edu
2018-02-14 19:26   ` Christof Warlich
2018-02-14 19:43     ` valdis.kletnieks at vt.edu
2018-02-14 20:47       ` Christof Warlich [this message]
2018-02-14 19:06 ` valdis.kletnieks at vt.edu

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=2bde6ec0-b4d0-1447-4380-eb51375df5be@gmx.de \
    --to=cwarlich@gmx.de \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.