* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
return ll_eopcode_table[opcode].opname;
}
-#ifdef LPROCFS
+#ifdef CONFIG_PROC_FS
static void ptlrpc_lprocfs_register(struct proc_dir_entry *root, char *dir,
char *name, struct proc_dir_entry **procroot_ret,
struct lprocfs_stats **stats_ret)
return;
if (dir) {
- svc_procroot = lprocfs_seq_register(dir, root, NULL, NULL);
+ svc_procroot = lprocfs_register(dir, root, NULL, NULL);
if (IS_ERR(svc_procroot)) {
lprocfs_free_stats(&svc_stats);
return;
rc = ptlrpc_lprocfs_svc_req_history_seek(svcpt, srhi, srhi->srhi_seq);
- if (rc == 0) {
- req = srhi->srhi_req;
-
- /* Print common req fields.
- * CAVEAT EMPTOR: we're racing with the service handler
- * here. The request could contain any old crap, so you
- * must be just as careful as the service's request
- * parser. Currently I only print stuff here I know is OK
- * to look at coz it was set up in request_in_callback()!!! */
- seq_printf(s, LPD64":%s:%s:x"LPU64":%d:%s:%ld:%lds(%+lds) ",
- req->rq_history_seq, libcfs_nid2str(req->rq_self),
- libcfs_id2str(req->rq_peer), req->rq_xid,
- req->rq_reqlen, ptlrpc_rqphase2str(req),
- req->rq_arrival_time.tv_sec,
- req->rq_sent - req->rq_arrival_time.tv_sec,
- req->rq_sent - req->rq_deadline);
+ if (rc == 0) {
+ char nidstr[LNET_NIDSTR_SIZE];
+
+ req = srhi->srhi_req;
+
+ libcfs_nid2str_r(req->rq_self, nidstr, sizeof(nidstr));
+ /* Print common req fields.
+ * CAVEAT EMPTOR: we're racing with the service handler
+ * here. The request could contain any old crap, so you
+ * must be just as careful as the service's request
+ * parser. Currently I only print stuff here I know is OK
+ * to look at coz it was set up in request_in_callback()!!! */
+ seq_printf(s, LPD64":%s:%s:x"LPU64":%d:%s:%ld:%lds(%+lds) ",
+ req->rq_history_seq, nidstr,
+ libcfs_id2str(req->rq_peer), req->rq_xid,
+ req->rq_reqlen, ptlrpc_rqphase2str(req),
+ req->rq_arrival_time.tv_sec,
+ req->rq_sent - req->rq_arrival_time.tv_sec,
+ req->rq_sent - req->rq_deadline);
if (svc->srv_ops.so_req_printer == NULL)
seq_printf(s, "\n");
else
svc->srv_ops.so_req_printer(s, srhi->srhi_req);
- }
+ }
spin_unlock(&svcpt->scp_lock);
return rc;
struct seq_file *seqf;
int rc;
- LPROCFS_ENTRY_CHECK(PDE(inode));
+ rc = LPROCFS_ENTRY_CHECK(inode);
+ if (rc < 0)
+ return rc;
+
rc = seq_open(file, &sops);
if (rc)
return rc;
DHMS_FMT" ago) ", "service",
cur, worst, worstt, DHMS_VARS(&ts));
- lprocfs_seq_at_hist_helper(m, &svcpt->scp_at_estimate);
+ lprocfs_at_hist_helper(m, &svcpt->scp_at_estimate);
}
return 0;
void ptlrpc_lprocfs_register_service(struct proc_dir_entry *entry,
struct ptlrpc_service *svc)
{
- struct lprocfs_seq_vars lproc_vars[] = {
+ struct lprocfs_vars lproc_vars[] = {
{ .name = "high_priority_ratio",
.fops = &ptlrpc_lprocfs_hp_ratio_fops,
.data = svc },
if (svc->srv_procroot == NULL)
return;
- lprocfs_seq_add_vars(svc->srv_procroot, lproc_vars, NULL);
+ lprocfs_add_vars(svc->srv_procroot, lproc_vars, NULL);
rc = lprocfs_seq_create(svc->srv_procroot, "req_history",
0400, &req_history_fops, svc);
}
EXPORT_SYMBOL(lprocfs_pinger_recov_seq_write);
-#endif /* LPROCFS */
+#endif /* CONFIG_PROC_FS */