[PATCH v4 2/7] Use printpid in decoders

Dmitry V. Levin ldv at altlinux.org
Fri Jul 31 09:52:17 UTC 2020


On Fri, Jul 31, 2020 at 11:42:14AM +0200, Ákos Uzonyi wrote:
> On Thu, 30 Jul 2020 at 22:42, Dmitry V. Levin wrote:
> > On Mon, Jul 27, 2020 at 08:54:05PM +0200, Ákos Uzonyi wrote:
> > [...]
> > > @@ -59,8 +59,23 @@ print_f_owner_ex(struct tcb *const tcp, const kernel_ulong_t addr)
> > >               return;
> > >
> > >       PRINT_FIELD_XVAL("{", owner, type, f_owner_types, "F_OWNER_???");
> > > -     PRINT_FIELD_D(", ", owner, pid);
> > > -     tprints("}");
> > > +
> > > +     enum pid_type pid_type = PT_NONE;
> > > +     switch (owner.type)
> > > +     {
> > > +     case F_OWNER_TID:
> > > +             pid_type = PT_TID;
> > > +             break;
> > > +     case F_OWNER_PID:
> > > +             pid_type = PT_TGID;
> > > +             break;
> > > +     case F_OWNER_PGRP:
> > > +             pid_type = PT_PGID;
> > > +             break;
> > > +     }
> > > +     tprintf(", pid=");
> > > +     printpid(tcp, owner.pid, pid_type);
> > > +     tprintf("}");
> > >  }
> >
> > Please make sure your changes do not replace tprints with tprintf
> > for printing strings without format specifiers.
> >
> > I sometimes forget to check this, so I have to commit cleanups like
> > 55d126a8d7dfedf51a862c377db36ce674b478d1 and
> > c5108cc878bfb65014c996be0eba0f9847bcb407 from time to time.
> 
> Okay, I will replace tprintf with tprints where possible.
> 
> Just a quick question: do you have a script to automatically generate
> the changelog entries for a commit message?

No, I don't use one for the reason that writing a changelog helps me to
have a look at the change being committed from a slightly different angle.

There is a gnulib vcs-to-changelog module, though, which is aimed
to generate an output similar to the GNU ChangeLog format from git.
Although it's used in glibc nowadays, I haven't tried it with strace.


-- 
ldv


More information about the Strace-devel mailing list