[PATCH v1] Changing print_dev_t to print raw device number if -Xraw

shankarapailoor shankarapailoor at gmail.com
Sun Dec 2 20:02:42 UTC 2018


Hi Dmitry,

The attached patch just changes the major and minor ids that we print
to hex. I am making this minor change a separate patch since I had to
change a bunch of tests. I will send the other patch after hearing
from you about this one.

Regards,
Shankara
On Sat, Dec 1, 2018 at 2:37 PM shankarapailoor
<shankarapailoor at gmail.com> wrote:
>
> Thanks Dmitry! I will add tests for all these changes and resubmit
> On Sat, Dec 1, 2018 at 2:34 PM Dmitry V. Levin <ldv at altlinux.org> wrote:
> >
> > On Sat, Dec 01, 2018 at 12:10:47PM -0800, shankarapailoor wrote:
> > > Hi,
> > >
> > > Attached is a patch to change print_dev_t to print the raw device
> > > number if -Xraw is passed. Making this an attachment since gmail
> > > converts tabs to spaces.
> > >
> > > Regards,
> > > Shankara
> >
> > > From 5ee7545cbf615b4f1a57ad54b588db0cb5448919 Mon Sep 17 00:00:00 2001
> > > From: Shankara Pailoor <shankarapailoor at gmail.com>
> > > Date: Sat, 1 Dec 2018 12:08:07 -0800
> > > Subject: [PATCH v1] Changing print_dev_t to print raw device number if -Xraw
> > >  is passed.
> > >
> > > ---
> > >  print_dev_t.c | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > >
> > > diff --git a/print_dev_t.c b/print_dev_t.c
> > > index 9b62f842..453b2381 100644
> > > --- a/print_dev_t.c
> > > +++ b/print_dev_t.c
> > > @@ -33,5 +33,17 @@
> > >  void
> > >  print_dev_t(const unsigned long long dev)
> > >  {
> > > +     if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
> > > +             tprintf("%llu", dev);
> > > +
> > > +     if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
> > > +             return;
> > > +
> > > +     if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
> > > +             tprints(" /* ");
> > > +
> > >       tprintf("makedev(%u, %u)", major(dev), minor(dev));
> > > +
> > > +     if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
> > > +             tprints("*/");
> > >  }
> >
> > This looks good, but have you considered printing the raw value in hex?
> > Looking at this parser, I think it would be better if major and minor numbers
> > were printed in hex, too.  For example, stat(1) prints them in hex.
> >
> > Also, please add a test for this change.
> >
> >
> > --
> > ldv
> > --
> > Strace-devel mailing list
> > Strace-devel at lists.strace.io
> > https://lists.strace.io/mailman/listinfo/strace-devel
>
>
>
> --
> Regards,
> Shankara Pailoor



-- 
Regards,
Shankara Pailoor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v1-0001-changing-makedev-to-print-major-minor-ids.patch
Type: text/x-patch
Size: 19851 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20181202/98a8c346/attachment.bin>


More information about the Strace-devel mailing list