From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: Or Gerlitz <gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Sagi Grimberg
<sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Subject: Re: [PATCH v5 1/6] IB/core, cma: Nice log-friendly string helpers
Date: Tue, 12 May 2015 13:21:47 -0400 [thread overview]
Message-ID: <1431451307.43876.67.camel@redhat.com> (raw)
In-Reply-To: <E27932C3-BDF3-4FED-ABD6-416454EFA5C0-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2639 bytes --]
On Tue, 2015-05-12 at 09:56 -0400, Chuck Lever wrote:
> On May 12, 2015, at 8:59 AM, Or Gerlitz <gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > On Tue, May 12, 2015 at 3:05 PM, Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
> >> Some of us keep revisiting the code to decode enumerations that
> >> appear in out logs. Let's borrow the nice logging helpers that
> >> exists in xprtrdma and rds for CMA events, IB events and WC statuses.
> >
> > [...]
> >
> >> +static const char * const cma_events[] = {
> >> + [RDMA_CM_EVENT_ADDR_RESOLVED] = "ADDR_RESOLVED",
> >> + [RDMA_CM_EVENT_ADDR_ERROR] = "ADDR_ERROR",
> >> + [RDMA_CM_EVENT_ROUTE_RESOLVED] = "ROUTE_RESOLVED",
> >> + [RDMA_CM_EVENT_ROUTE_ERROR] = "ROUTE_ERROR",
> >> + [RDMA_CM_EVENT_CONNECT_REQUEST] = "CONNECT_REQUEST",
> >> + [RDMA_CM_EVENT_CONNECT_RESPONSE]= "CONNECT_RESPONSE",
> >> + [RDMA_CM_EVENT_CONNECT_ERROR] = "CONNECT_ERROR",
> >> + [RDMA_CM_EVENT_UNREACHABLE] = "UNREACHABLE",
> >> + [RDMA_CM_EVENT_REJECTED] = "REJECTED",
> >> + [RDMA_CM_EVENT_ESTABLISHED] = "ESTABLISHED",
> >> + [RDMA_CM_EVENT_DISCONNECTED] = "DISCONNECTED",
> >> + [RDMA_CM_EVENT_DEVICE_REMOVAL] = "DEVICE_REMOVAL",
> >> + [RDMA_CM_EVENT_MULTICAST_JOIN] = "MULTICAST_JOIN",
> >> + [RDMA_CM_EVENT_MULTICAST_ERROR] = "MULTICAST_ERROR",
> >> + [RDMA_CM_EVENT_ADDR_CHANGE] = "ADDR_CHANGE",
> >> + [RDMA_CM_EVENT_TIMEWAIT_EXIT] = "TIMEWAIT_EXIT",
> >> +};
> >
> > Sagi,
> >
> > My vote goes to using easy-to-digest human-readable non-capital
> > letters strings here and
> > elsewhere (IB events, etc), as done today by the NFS code and
> > generally by errno based
> > helpers such as strerror, e.g
> >
> > "address resolved"
> > "address error"
> > "route resolved"
> >
> > Will be happy to hear what others think
>
> I generally prefer spelled-out strings over symbol names.
>
> For the strings in xprtrdma, I looked up the symbols in the IBTA spec,
> and used part of the description of each error. It’s obvious in most
> cases, but there are one or two that are a little odd (eg. MW_BIND_ERR
> is “memory management operation error”).
Likewise, I prefer the more complete description to a simple
regurgitation of C preprocessor symbols. Aside from that, I'm glad to
see this patchset come along because I hate looking up error numbers
too.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: 0E572FDD
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-05-12 17:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 12:05 Generic logging helpers [v5] Sagi Grimberg
[not found] ` <1431432329-859-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-05-12 12:05 ` [PATCH v5 1/6] IB/core, cma: Nice log-friendly string helpers Sagi Grimberg
[not found] ` <1431432329-859-2-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-05-12 12:59 ` Or Gerlitz
[not found] ` <CAJ3xEMhOnrZJrUfwtMs7Tod7YeGy_Be6yF543+xds_05hO-F-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-12 13:33 ` Sagi Grimberg
2015-05-12 13:56 ` Chuck Lever
[not found] ` <E27932C3-BDF3-4FED-ABD6-416454EFA5C0-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-05-12 17:21 ` Doug Ledford [this message]
2015-05-12 12:05 ` [PATCH v5 2/6] IB/srp: Align to generic logging helpers Sagi Grimberg
2015-05-12 12:05 ` [PATCH v5 3/6] IB/iser: " Sagi Grimberg
2015-05-12 12:05 ` [PATCH v5 4/6] iser-target: " Sagi Grimberg
2015-05-12 12:05 ` [PATCH v5 5/6] xprtrdma: Switch " Sagi Grimberg
[not found] ` <1431432329-859-6-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-05-12 12:40 ` Yann Droneaud
[not found] ` <1431434425.25060.65.camel-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2015-05-12 13:08 ` Sagi Grimberg
2015-05-12 12:05 ` [PATCH v5 6/6] RDS: " Sagi Grimberg
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=1431451307.43876.67.camel@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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.