Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: strace completion (Re: grouping/joining _values)



On Fri, Jun 13, 2008 at 06:18:51AM -0700, Phil Pennock wrote:
> On 2008-06-13 at 12:12 +0000, Clint Adams wrote:
> > On Fri, Jun 13, 2008 at 04:33:02AM -0700, Phil Pennock wrote:
> > > Are there any other useful strategies for extracting the real list of
> > > syscalls at runtime, so that on systems which package up the same
> > > version of zsh for N years the list doesn't grow stale?
> > 
> > On the other hand, the list of syscalls is hard-coded into strace at
> > build time, so you probably don't want a dynamic completion list either.
> 
> On the gripping hand, the modification time of the zsh completion file
> in a particular distribution probably has little, if any, correlation to
> the build time of strace.  Especially when zsh devel work happens on a
> devel branch with many years between "stable" releases, so many OSes by
> default are shipping zsh 4.2.x, so zsh 4.4.x will hang around for a long
> time.
> 
> The closest we can come to being up-to-date is to get the values as
> currently known on the system; if strace hasn't been rebuilt recently,
> that's not zsh's problem.  :)  That's for the sysadmin to rebuild strace
> to get the latest syscalls if they're interested in them.
> 
> If we can't get the values currently known, then we're back to
> approximations.  If we had a portable non-gcc way of doing this, I'd
> feel better about saying "if you don't have a compiler, why are you
> analysing trace dumps", thus my question above, seeking other techniques
> for extracting the list.
[...]

You could get the list from strace itself with:

ltrace -e strcmp strace -e xxx |& awk -F\" '
  /xxx/&&/strcmp/{print $4}' | sort -u

-- 
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author