From 22bc0e210fd4f399083715700c992e2742973cc2 Mon Sep 17 00:00:00 2001 From: lsy Date: Tue, 2 Nov 2004 03:37:11 +0000 Subject: [PATCH] b=4645 r=adilger print NAL number in %x format (4645) --- lustre/ChangeLog | 1 + lustre/obdclass/lustre_peer.c | 2 +- lustre/obdclass/obd_config.c | 6 +++--- lustre/portals/libcfs/module.c | 10 ++++----- lustre/portals/portals/api-ni.c | 6 +++--- lustre/portals/portals/module.c | 2 +- lustre/portals/router/router.c | 44 ++++++++++++++++++++-------------------- lustre/portals/tests/ping_cli.c | 4 ++-- lustre/portals/tests/ping_srv.c | 2 +- lustre/portals/tests/sping_cli.c | 4 ++-- lustre/portals/tests/sping_srv.c | 2 +- lustre/ptlrpc/events.c | 4 ++-- lustre/utils/llmount.c | 2 +- 13 files changed, 45 insertions(+), 44 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index c898563..dc192d1 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -27,6 +27,7 @@ tbd Cluster File Systems, Inc. - add software watchdogs to catch hung threads quickly (4941) - make lustrefs init script start after nfs is mounted - fix CWARN/ERROR duplication (4930) + - print NAL number in %x format (4645) 2004-10-07 Cluster File Systems, Inc. * version 1.2.7 diff --git a/lustre/obdclass/lustre_peer.c b/lustre/obdclass/lustre_peer.c index 4489671..9b1ec40 100644 --- a/lustre/obdclass/lustre_peer.c +++ b/lustre/obdclass/lustre_peer.c @@ -103,7 +103,7 @@ int class_add_uuid(char *uuid, __u64 nid, __u32 nal) return -ENOMEM; } - CDEBUG(D_INFO, "add uuid %s "LPX64" %u\n", uuid, nid, nal); + CDEBUG(D_INFO, "add uuid %s "LPX64" %x\n", uuid, nid, nal); memcpy(data->uuid, uuid, nob); data->nid = nid; data->nal = nal; diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index afed455..60510a0 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -435,7 +435,7 @@ int class_process_config(struct lustre_cfg *lcfg) } case LCFG_ADD_UUID: { CDEBUG(D_IOCTL, "adding mapping from uuid %s to nid "LPX64 - " (%s), nal %d\n", lcfg->lcfg_inlbuf1, lcfg->lcfg_nid, + " (%s), nal %x\n", lcfg->lcfg_inlbuf1, lcfg->lcfg_nid, portals_nid2str(lcfg->lcfg_nal, lcfg->lcfg_nid, str), lcfg->lcfg_nal); @@ -662,10 +662,10 @@ int class_config_dump_handler(struct llog_handle * handle, CDEBUG(D_INFO, "pcfg command: %d\n", pcfg->pcfg_command); if (pcfg->pcfg_nal) - CDEBUG(D_INFO, " nal: %d\n", + CDEBUG(D_INFO, " nal: %x\n", pcfg->pcfg_nal); if (pcfg->pcfg_gw_nal) - CDEBUG(D_INFO, " gw_nal: %d\n", + CDEBUG(D_INFO, " gw_nal: %x\n", pcfg->pcfg_gw_nal); if (pcfg->pcfg_nid) CDEBUG(D_INFO, " nid: "LPX64"\n", diff --git a/lustre/portals/libcfs/module.c b/lustre/portals/libcfs/module.c index a2422e3..c627622 100644 --- a/lustre/portals/libcfs/module.c +++ b/lustre/portals/libcfs/module.c @@ -266,7 +266,7 @@ libcfs_nal_cmd_register(int nal, nal_cmd_handler_fn *handler, void *private) int i; int rc; - CDEBUG(D_IOCTL, "Register NAL %d, handler: %p\n", nal, handler); + CDEBUG(D_IOCTL, "Register NAL %x, handler: %p\n", nal, handler); down(&nal_cmd_sem); @@ -302,7 +302,7 @@ libcfs_nal_cmd_unregister(int nal) { struct nal_cmd_handler *cmd; - CDEBUG(D_IOCTL, "Unregister NAL %d\n", nal); + CDEBUG(D_IOCTL, "Unregister NAL %x\n", nal); down(&nal_cmd_sem); cmd = libcfs_find_nal_cmd_handler(nal); @@ -324,11 +324,11 @@ libcfs_nal_cmd(struct portals_cfg *pcfg) down(&nal_cmd_sem); cmd = libcfs_find_nal_cmd_handler(nal); if (cmd != NULL) { - CDEBUG(D_IOCTL, "calling handler nal: %d, cmd: %d\n", nal, + CDEBUG(D_IOCTL, "calling handler nal: %x, cmd: %d\n", nal, pcfg->pcfg_command); rc = cmd->nch_handler(pcfg, cmd->nch_private); } else { - CERROR("invalid nal: %d, cmd: %d\n", nal, pcfg->pcfg_command); + CERROR("invalid nal: %x, cmd: %d\n", nal, pcfg->pcfg_command); } up(&nal_cmd_sem); @@ -464,7 +464,7 @@ static int libcfs_ioctl(struct inode *inode, struct file *file, break; } - CDEBUG (D_IOCTL, "nal command nal %d cmd %d\n", pcfg.pcfg_nal, + CDEBUG (D_IOCTL, "nal command nal %x cmd %d\n", pcfg.pcfg_nal, pcfg.pcfg_command); err = libcfs_nal_cmd(&pcfg); diff --git a/lustre/portals/portals/api-ni.c b/lustre/portals/portals/api-ni.c index 72d3b41..7e92256 100644 --- a/lustre/portals/portals/api-ni.c +++ b/lustre/portals/portals/api-ni.c @@ -165,7 +165,7 @@ void PtlFini(void) continue; if (nal->nal_refct != 0) { - CWARN("NAL %d has outstanding refcount %d\n", + CWARN("NAL %x has outstanding refcount %d\n", i, nal->nal_refct); nal->nal_ni_fini(nal); } @@ -212,11 +212,11 @@ int PtlNIInit(ptl_interface_t interface, ptl_pid_t requested_pid, nal->nal_handle.nal_idx = (NI_HANDLE_MAGIC & ~NI_HANDLE_MASK) | interface; nal->nal_handle.cookie = 0; - CDEBUG(D_OTHER, "Starting up NAL (%d) refs %d\n", interface, nal->nal_refct); + CDEBUG(D_OTHER, "Starting up NAL (%x) refs %d\n", interface, nal->nal_refct); rc = nal->nal_ni_init(nal, requested_pid, desired_limits, actual_limits); if (rc != PTL_OK) { - CERROR("Error %d starting up NAL %d, refs %d\n", rc, + CERROR("Error %d starting up NAL %x, refs %d\n", rc, interface, nal->nal_refct); GOTO(out, rc); } diff --git a/lustre/portals/portals/module.c b/lustre/portals/portals/module.c index 61ef372..c1303b7 100644 --- a/lustre/portals/portals/module.c +++ b/lustre/portals/portals/module.c @@ -81,7 +81,7 @@ static int kportal_ioctl(struct portal_ioctl_data *data, ptl_handle_ni_t nih; ptl_process_id_t pid; - CDEBUG (D_IOCTL, "Getting nid for nal [%d]\n", data->ioc_nal); + CDEBUG (D_IOCTL, "Getting nid for nal [%x]\n", data->ioc_nal); err = PtlNIInit(data->ioc_nal, LUSTRE_SRV_PTL_PID, NULL, NULL, &nih); diff --git a/lustre/portals/router/router.c b/lustre/portals/router/router.c index 448ab1f..7edc5f6 100644 --- a/lustre/portals/router/router.c +++ b/lustre/portals/router/router.c @@ -56,7 +56,7 @@ kpr_register_nal (kpr_nal_interface_t *nalif, void **argp) struct list_head *e; kpr_nal_entry_t *ne; - CDEBUG (D_NET, "Registering NAL %d\n", nalif->kprni_nalid); + CDEBUG (D_NET, "Registering NAL %x\n", nalif->kprni_nalid); PORTAL_ALLOC (ne, sizeof (*ne)); if (ne == NULL) @@ -76,7 +76,7 @@ kpr_register_nal (kpr_nal_interface_t *nalif, void **argp) { write_unlock_irqrestore (&kpr_rwlock, flags); - CERROR ("Attempt to register same NAL %d twice\n", ne->kpne_interface.kprni_nalid); + CERROR ("Attempt to register same NAL %x twice\n", ne->kpne_interface.kprni_nalid); PORTAL_FREE (ne, sizeof (*ne)); return (-EEXIST); @@ -126,7 +126,7 @@ kpr_upcall (int gw_nalid, ptl_nid_t gw_nid, int alive, time_t when) kpr_upcall_t *u = kmalloc (sizeof (kpr_upcall_t), GFP_ATOMIC); if (u == NULL) { - CERROR ("Upcall out of memory: nal %d nid "LPX64" (%s) %s\n", + CERROR ("Upcall out of memory: nal %x nid "LPX64" (%s) %s\n", gw_nalid, gw_nid, portals_nid2str(gw_nalid, gw_nid, str), alive ? "up" : "down"); @@ -155,14 +155,14 @@ kpr_do_notify (int byNal, int gateway_nalid, ptl_nid_t gateway_nid, struct list_head *n; char str[PTL_NALFMT_SIZE]; - CDEBUG (D_NET, "%s notifying [%d] "LPX64": %s\n", + CDEBUG (D_NET, "%s notifying [%x] "LPX64": %s\n", byNal ? "NAL" : "userspace", gateway_nalid, gateway_nid, alive ? "up" : "down"); /* can't do predictions... */ do_gettimeofday (&now); if (when > now.tv_sec) { - CWARN ("Ignoring prediction from %s of [%d] "LPX64" %s " + CWARN ("Ignoring prediction from %s of [%x] "LPX64" %s " "%ld seconds in the future\n", byNal ? "NAL" : "userspace", gateway_nalid, gateway_nid, @@ -252,7 +252,7 @@ kpr_do_notify (int byNal, int gateway_nalid, ptl_nid_t gateway_nid, if (byNal) { /* It wasn't userland that notified me... */ - CWARN ("Upcall: NAL %d NID "LPX64" (%s) is %s\n", + CWARN ("Upcall: NAL %x NID "LPX64" (%s) is %s\n", gateway_nalid, gateway_nid, portals_nid2str(gateway_nalid, gateway_nid, str), alive ? "alive" : "dead"); @@ -278,7 +278,7 @@ kpr_shutdown_nal (void *arg) unsigned long flags; kpr_nal_entry_t *ne = (kpr_nal_entry_t *)arg; - CDEBUG (D_NET, "Shutting down NAL %d\n", ne->kpne_interface.kprni_nalid); + CDEBUG (D_NET, "Shutting down NAL %x\n", ne->kpne_interface.kprni_nalid); LASSERT (!ne->kpne_shutdown); LASSERT (!in_interrupt()); @@ -294,7 +294,7 @@ kpr_deregister_nal (void *arg) unsigned long flags; kpr_nal_entry_t *ne = (kpr_nal_entry_t *)arg; - CDEBUG (D_NET, "Deregister NAL %d\n", ne->kpne_interface.kprni_nalid); + CDEBUG (D_NET, "Deregister NAL %x\n", ne->kpne_interface.kprni_nalid); LASSERT (ne->kpne_shutdown); /* caller must have issued shutdown already */ LASSERT (!in_interrupt()); @@ -306,7 +306,7 @@ kpr_deregister_nal (void *arg) /* Wait until all outstanding messages/notifications have completed */ while (atomic_read (&ne->kpne_refcount) != 0) { - CDEBUG (D_NET, "Waiting for refcount on NAL %d to reach zero (%d)\n", + CDEBUG (D_NET, "Waiting for refcount on NAL %x to reach zero (%d)\n", ne->kpne_interface.kprni_nalid, atomic_read (&ne->kpne_refcount)); set_current_state (TASK_UNINTERRUPTIBLE); @@ -367,7 +367,7 @@ kpr_lookup_target (void *arg, ptl_nid_t target_nid, int nob, /* Caller wants to know if 'target_nid' can be reached via a gateway * ON HER OWN NETWORK */ - CDEBUG (D_NET, "lookup "LPX64" from NAL %d\n", target_nid, + CDEBUG (D_NET, "lookup "LPX64" from NAL %x\n", target_nid, ne->kpne_interface.kprni_nalid); LASSERT (!in_interrupt()); @@ -411,7 +411,7 @@ kpr_lookup_target (void *arg, ptl_nid_t target_nid, int nob, /* NB can't deref 're' now; it might have been removed! */ - CDEBUG (D_NET, "lookup "LPX64" from NAL %d: %d ("LPX64")\n", + CDEBUG (D_NET, "lookup "LPX64" from NAL %x: %d ("LPX64")\n", target_nid, ne->kpne_interface.kprni_nalid, rc, (rc == 0) ? *gateway_nidp : (ptl_nid_t)0); return (rc); @@ -449,7 +449,7 @@ kpr_forward_packet (void *arg, kpr_fwd_desc_t *fwd) kpr_nal_entry_t *tmp_ne; int rc; - CDEBUG (D_NET, "forward [%p] "LPX64" from NAL %d\n", fwd, + CDEBUG (D_NET, "forward [%p] "LPX64" from NAL %x\n", fwd, target_nid, src_ne->kpne_interface.kprni_nalid); LASSERT (nob == lib_kiov_nob (fwd->kprfd_niov, fwd->kprfd_kiov)); @@ -509,8 +509,8 @@ kpr_forward_packet (void *arg, kpr_fwd_desc_t *fwd) read_unlock (&kpr_rwlock); - CDEBUG (D_NET, "forward [%p] "LPX64" from NAL %d: " - "to "LPX64" on NAL %d\n", + CDEBUG (D_NET, "forward [%p] "LPX64" from NAL %x: " + "to "LPX64" on NAL %x\n", fwd, target_nid, src_ne->kpne_interface.kprni_nalid, fwd->kprfd_gateway_nid, dst_ne->kpne_interface.kprni_nalid); @@ -522,7 +522,7 @@ kpr_forward_packet (void *arg, kpr_fwd_desc_t *fwd) out: kpr_fwd_errors++; - CDEBUG (D_NET, "Failed to forward [%p] "LPX64" from NAL %d: %d\n", + CDEBUG (D_NET, "Failed to forward [%p] "LPX64" from NAL %x: %d\n", fwd, target_nid, src_ne->kpne_interface.kprni_nalid, rc); (fwd->kprfd_callback)(fwd->kprfd_callback_arg, rc); @@ -536,14 +536,14 @@ kpr_complete_packet (void *arg, kpr_fwd_desc_t *fwd, int error) kpr_nal_entry_t *dst_ne = (kpr_nal_entry_t *)arg; kpr_nal_entry_t *src_ne = (kpr_nal_entry_t *)fwd->kprfd_router_arg; - CDEBUG (D_NET, "complete(1) [%p] from NAL %d to NAL %d: %d\n", fwd, + CDEBUG (D_NET, "complete(1) [%p] from NAL %x to NAL %x: %d\n", fwd, src_ne->kpne_interface.kprni_nalid, dst_ne->kpne_interface.kprni_nalid, error); atomic_dec (&dst_ne->kpne_refcount); /* CAVEAT EMPTOR dst_ne can disappear now!!! */ (fwd->kprfd_callback)(fwd->kprfd_callback_arg, error); - CDEBUG (D_NET, "complete(2) [%p] from NAL %d: %d\n", fwd, + CDEBUG (D_NET, "complete(2) [%p] from NAL %x: %d\n", fwd, src_ne->kpne_interface.kprni_nalid, error); atomic_dec (&kpr_queue_depth); @@ -560,7 +560,7 @@ kpr_add_route (int gateway_nalid, ptl_nid_t gateway_nid, kpr_gateway_entry_t *ge; int dup = 0; - CDEBUG(D_NET, "Add route: %d "LPX64" : "LPX64" - "LPX64"\n", + CDEBUG(D_NET, "Add route: %x "LPX64" : "LPX64" - "LPX64"\n", gateway_nalid, gateway_nid, lo_nid, hi_nid); if (gateway_nalid == PTL_NID_ANY || @@ -645,7 +645,7 @@ kpr_del_route (int gw_nalid, ptl_nid_t gw_nid, struct list_head *e; struct list_head *n; - CDEBUG(D_NET, "Del route [%d] "LPX64" : "LPX64" - "LPX64"\n", + CDEBUG(D_NET, "Del route [%x] "LPX64" : "LPX64" - "LPX64"\n", gw_nalid, gw_nid, lo, hi); LASSERT(!in_interrupt()); @@ -731,7 +731,7 @@ kpr_nal_cmd(struct portals_cfg *pcfg, void * private) break; case NAL_CMD_ADD_ROUTE: - CDEBUG(D_IOCTL, "Adding route: [%d] "LPU64" : "LPU64" - "LPU64"\n", + CDEBUG(D_IOCTL, "Adding route: [%x] "LPU64" : "LPU64" - "LPU64"\n", pcfg->pcfg_nal, pcfg->pcfg_nid, pcfg->pcfg_nid2, pcfg->pcfg_nid3); err = kpr_add_route(pcfg->pcfg_gw_nal, pcfg->pcfg_nid, @@ -739,7 +739,7 @@ kpr_nal_cmd(struct portals_cfg *pcfg, void * private) break; case NAL_CMD_DEL_ROUTE: - CDEBUG (D_IOCTL, "Removing routes via [%d] "LPU64" : "LPU64" - "LPU64"\n", + CDEBUG (D_IOCTL, "Removing routes via [%x] "LPU64" : "LPU64" - "LPU64"\n", pcfg->pcfg_gw_nal, pcfg->pcfg_nid, pcfg->pcfg_nid2, pcfg->pcfg_nid3); err = kpr_del_route (pcfg->pcfg_gw_nal, pcfg->pcfg_nid, @@ -747,7 +747,7 @@ kpr_nal_cmd(struct portals_cfg *pcfg, void * private) break; case NAL_CMD_NOTIFY_ROUTER: { - CDEBUG (D_IOCTL, "Notifying peer [%d] "LPU64" %s @ %ld\n", + CDEBUG (D_IOCTL, "Notifying peer [%x] "LPU64" %s @ %ld\n", pcfg->pcfg_gw_nal, pcfg->pcfg_nid, pcfg->pcfg_flags ? "Enabling" : "Disabling", (time_t)pcfg->pcfg_nid3); diff --git a/lustre/portals/tests/ping_cli.c b/lustre/portals/tests/ping_cli.c index 7a3f8a0..e9a8481 100644 --- a/lustre/portals/tests/ping_cli.c +++ b/lustre/portals/tests/ping_cli.c @@ -114,7 +114,7 @@ pingcli_start(struct portal_ioctl_data *args) client->tsk = current; client->args = args; CDEBUG (D_OTHER, "pingcli_setup args: nid "LPX64" (%s), \ - nal %d, size %u, count: %u, timeout: %u\n", + nal %x, size %u, count: %u, timeout: %u\n", args->ioc_nid, portals_nid2str(args->ioc_nal, args->ioc_nid, str), args->ioc_nal, args->ioc_size, @@ -142,7 +142,7 @@ pingcli_start(struct portal_ioctl_data *args) rc = PtlNIInit(args->ioc_nal, 0, NULL, NULL, &nih); if (rc != PTL_OK || rc != PTL_IFACE_DUP) { - CERROR ("NAL %d not loaded\n", args->ioc_nal); + CERROR ("NAL %x not loaded\n", args->ioc_nal); pingcli_shutdown (nih, 4); return (NULL); } diff --git a/lustre/portals/tests/ping_srv.c b/lustre/portals/tests/ping_srv.c index dec806a..49e82af 100644 --- a/lustre/portals/tests/ping_srv.c +++ b/lustre/portals/tests/ping_srv.c @@ -206,7 +206,7 @@ static struct pingsrv_data *pingsrv_setup(void) /* Aquire and initialize the proper nal for portals. */ rc = PtlNIInit(nal, 0, NULL, NULL, &server->ni); if (!(rc == PTL_OK || rc == PTL_IFACE_DUP)) { - CDEBUG (D_OTHER, "NAL %d not loaded\n", nal); + CDEBUG (D_OTHER, "NAL %x not loaded\n", nal); return pingsrv_shutdown (4); } diff --git a/lustre/portals/tests/sping_cli.c b/lustre/portals/tests/sping_cli.c index 730ba00..d9970e7 100644 --- a/lustre/portals/tests/sping_cli.c +++ b/lustre/portals/tests/sping_cli.c @@ -110,7 +110,7 @@ pingcli_start(struct portal_ioctl_data *args) client->args = args; CDEBUG (D_OTHER, "pingcli_setup args: nid "LPX64" (%s), \ - nal %d, size %u, count: %u, timeout: %u\n", + nal %x, size %u, count: %u, timeout: %u\n", args->ioc_nid, portals_nid2str(args->ioc_nid, args->ioc_nal, str), args->ioc_nal, args->ioc_size, @@ -138,7 +138,7 @@ pingcli_start(struct portal_ioctl_data *args) rc = PtlNIInit(args->ioc_nal, 0, NULL, NULL, &nih); if (rc != PTL_OK && rc != PTL_IFACE_DUP) { - CERROR ("NAL %d not loaded.\n", args->ioc_nal); + CERROR ("NAL %x not loaded.\n", args->ioc_nal); pingcli_shutdown (nih, 4); return (NULL); } diff --git a/lustre/portals/tests/sping_srv.c b/lustre/portals/tests/sping_srv.c index f2382d1..069423d 100644 --- a/lustre/portals/tests/sping_srv.c +++ b/lustre/portals/tests/sping_srv.c @@ -195,7 +195,7 @@ static struct pingsrv_data *pingsrv_setup(void) rc = PtlNIInit(nal, 0, NULL, NULL, &server->ni); if (rc != PTL_OK && rc != PTL_IFACE_DUP) { - CDEBUG (D_OTHER, "Nal %d not loaded.\n", nal); + CDEBUG (D_OTHER, "Nal %x not loaded.\n", nal); return pingsrv_shutdown (4); } diff --git a/lustre/ptlrpc/events.c b/lustre/ptlrpc/events.c index a2e5bc2..b357c77 100644 --- a/lustre/ptlrpc/events.c +++ b/lustre/ptlrpc/events.c @@ -369,7 +369,7 @@ int ptlrpc_uuid_to_peer (struct obd_uuid *uuid, struct ptlrpc_peer *peer) } } - CERROR("Can't find ptlrpc interface for NAL %d, NID %s\n", + CERROR("Can't find ptlrpc interface for NAL %x, NID %s\n", peer_nal, portals_nid2str(peer_nal, peer_nid, str)); return (-ENOENT); } @@ -443,7 +443,7 @@ int ptlrpc_ni_init(int number, char *name, struct ptlrpc_ni *pni) CDEBUG(D_NET, "My pid is: %x\n", ptl_get_pid()); PtlSnprintHandle(str, sizeof(str), nih); - CDEBUG (D_NET, "init %d %s: %s\n", number, name, str); + CDEBUG (D_NET, "init %x %s: %s\n", number, name, str); pni->pni_name = name; pni->pni_number = number; diff --git a/lustre/utils/llmount.c b/lustre/utils/llmount.c index 4440997..60e81a5 100644 --- a/lustre/utils/llmount.c +++ b/lustre/utils/llmount.c @@ -127,7 +127,7 @@ print_options(struct lustre_mount_data *lmd) printf("profile: %s\n", lmd->lmd_profile); printf("server_nid: "LPX64"\n", lmd->lmd_server_nid); printf("local_nid: "LPX64"\n", lmd->lmd_local_nid); - printf("nal: %d\n", lmd->lmd_nal); + printf("nal: %x\n", lmd->lmd_nal); printf("server_ipaddr: 0x%x\n", lmd->lmd_server_ipaddr); printf("port: %d\n", lmd->lmd_port); -- 1.8.3.1