Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
b=14330
[fs/lustre-release.git]
/
lustre
/
ptlrpc
/
lproc_ptlrpc.c
diff --git
a/lustre/ptlrpc/lproc_ptlrpc.c
b/lustre/ptlrpc/lproc_ptlrpc.c
index
0730b0f
..
e4ffb22
100644
(file)
--- a/
lustre/ptlrpc/lproc_ptlrpc.c
+++ b/
lustre/ptlrpc/lproc_ptlrpc.c
@@
-55,8
+55,8
@@
struct ll_rpc_opcode {
{ OST_OPEN, "ost_open" },
{ OST_CLOSE, "ost_close" },
{ OST_STATFS, "ost_statfs" },
- { 14,
"ost_san_read" },
- { 15,
"ost_san_write" },
+ { 14,
NULL }, /* formerly OST_SAN_READ */
+ { 15,
NULL }, /* formerly OST_SAN_WRITE */
{ OST_SYNC, "ost_sync" },
{ OST_SET_INFO, "ost_set_info" },
{ OST_QUOTACHECK, "ost_quotacheck" },
@@
-92,18
+92,19
@@
struct ll_rpc_opcode {
{ MGS_EXCEPTION, "mgs_exception" },
{ MGS_TARGET_REG, "mgs_target_reg" },
{ MGS_TARGET_DEL, "mgs_target_del" },
+ { MGS_SET_INFO, "mgs_set_info" },
{ OBD_PING, "obd_ping" },
{ OBD_LOG_CANCEL, "llog_origin_handle_cancel" },
{ OBD_QC_CALLBACK, "obd_qc_callback" },
- { LLOG_ORIGIN_HANDLE_CREATE, "llog_origin_handle_create" },
+ { LLOG_ORIGIN_HANDLE_CREATE,
"llog_origin_handle_create" },
{ LLOG_ORIGIN_HANDLE_NEXT_BLOCK, "llog_origin_handle_next_block" },
- { LLOG_ORIGIN_HANDLE_READ_HEADER,
"llog_origin_handle_read_header" },
- { LLOG_ORIGIN_HANDLE_WRITE_REC, "llog_origin_handle_write_rec" },
- { LLOG_ORIGIN_HANDLE_CLOSE, "llog_origin_handle_close" },
- { LLOG_ORIGIN_CONNECT, "llog_origin_connect" },
- { LLOG_CATINFO, "llog_catinfo" },
+ { LLOG_ORIGIN_HANDLE_READ_HEADER,"llog_origin_handle_read_header" },
+ { LLOG_ORIGIN_HANDLE_WRITE_REC,
"llog_origin_handle_write_rec" },
+ { LLOG_ORIGIN_HANDLE_CLOSE,
"llog_origin_handle_close" },
+ { LLOG_ORIGIN_CONNECT,
"llog_origin_connect" },
+ { LLOG_CATINFO,
"llog_catinfo" },
{ LLOG_ORIGIN_HANDLE_PREV_BLOCK, "llog_origin_handle_prev_block" },
- { LLOG_ORIGIN_HANDLE_DESTROY, "llog_origin_handle_destroy" },
+ { LLOG_ORIGIN_HANDLE_DESTROY,
"llog_origin_handle_destroy" },
{ FLD_QUERY, "fld_query" },
{ SEQ_QUERY, "seq_query" },
{ SEC_CTX_INIT, "sec_ctx_init" },
@@
-111,7
+112,24
@@
struct ll_rpc_opcode {
{ SEC_CTX_FINI, "sec_ctx_fini" }
};
-const char* ll_opcode2str(__u32 opcode)
+struct ll_eopcode {
+ __u32 opcode;
+ const char *opname;
+} ll_eopcode_table[EXTRA_LAST_OPC] = {
+ { LDLM_GLIMPSE_ENQUEUE, "ldlm_glimpse_enqueue" },
+ { LDLM_PLAIN_ENQUEUE, "ldlm_plain_enqueue" },
+ { LDLM_EXTENT_ENQUEUE, "ldlm_extent_enqueue" },
+ { LDLM_FLOCK_ENQUEUE, "ldlm_flock_enqueue" },
+ { LDLM_IBITS_ENQUEUE, "ldlm_ibits_enqueue" },
+ { MDS_REINT_CREATE, "mds_reint_create" },
+ { MDS_REINT_LINK, "mds_reint_link" },
+ { MDS_REINT_OPEN, "mds_reint_open" },
+ { MDS_REINT_SETATTR, "mds_reint_setattr" },
+ { MDS_REINT_RENAME, "mds_reint_rename" },
+ { MDS_REINT_UNLINK, "mds_reint_unlink" }
+};
+
+const char *ll_opcode2str(__u32 opcode)
{
/* When one of the assertions below fail, chances are that:
* 1) A new opcode was added in lustre_idl.h, but was
@@
-126,6
+144,11
@@
const char* ll_opcode2str(__u32 opcode)
return ll_rpc_opcode_table[offset].opname;
}
+const char* ll_eopcode2str(__u32 opcode)
+{
+ LASSERT(ll_eopcode_table[opcode].opcode == opcode);
+ return ll_eopcode_table[opcode].opname;
+}
#ifdef LPROCFS
void ptlrpc_lprocfs_register(struct proc_dir_entry *root, char *dir,
char *name, struct proc_dir_entry **procroot_ret,
@@
-140,7
+163,7
@@
void ptlrpc_lprocfs_register(struct proc_dir_entry *root, char *dir,
LASSERT(*procroot_ret == NULL);
LASSERT(*stats_ret == NULL);
- svc_stats = lprocfs_alloc_stats(
PTLRPC_LAST_CNTR + LUSTRE_MAX_OPCODES
);
+ svc_stats = lprocfs_alloc_stats(
EXTRA_MAX_OPCODES + LUSTRE_MAX_OPCODES, 0
);
if (svc_stats == NULL)
return;
@@
-162,11
+185,16
@@
void ptlrpc_lprocfs_register(struct proc_dir_entry *root, char *dir,
svc_counter_config, "req_active", "reqs");
lprocfs_counter_init(svc_stats, PTLRPC_REQBUF_AVAIL_CNTR,
svc_counter_config, "reqbuf_avail", "bufs");
+ for (i = 0; i < EXTRA_LAST_OPC; i++) {
+ lprocfs_counter_init(svc_stats, PTLRPC_LAST_CNTR + i,
+ svc_counter_config,
+ ll_eopcode2str(i), "reqs");
+ }
for (i = 0; i < LUSTRE_MAX_OPCODES; i++) {
__u32 opcode = ll_rpc_opcode_table[i].opcode;
- lprocfs_counter_init(svc_stats,
PTLRPC_LAST_CNTR + i,
-
svc_counter_config, ll_opcode2str(opcode)
,
- "usec");
+ lprocfs_counter_init(svc_stats,
+
EXTRA_MAX_OPCODES + i, svc_counter_config
,
+
ll_opcode2str(opcode),
"usec");
}
rc = lprocfs_register_stats(svc_procroot, name, svc_stats);
@@
-443,15
+471,17
@@
EXPORT_SYMBOL(ptlrpc_lprocfs_register_obd);
void ptlrpc_lprocfs_rpc_sent(struct ptlrpc_request *req)
{
struct lprocfs_stats *svc_stats;
- int opc = opcode_offset(lustre_msg_get_opc(req->rq_reqmsg));
+ __u32 op = lustre_msg_get_opc(req->rq_reqmsg);
+ int opc = opcode_offset(op);
svc_stats = req->rq_import->imp_obd->obd_svc_stats;
if (svc_stats == NULL || opc <= 0)
return;
LASSERT(opc < LUSTRE_MAX_OPCODES);
/* These two use the ptlrpc_lprocfs_brw below */
- if (!(opc == OST_WRITE || opc == OST_READ))
- lprocfs_counter_add(svc_stats, opc + PTLRPC_LAST_CNTR, 0);
+ if (!(opc == OST_WRITE || opc == OST_READ || op == LDLM_ENQUEUE
+ || op == MDS_REINT))
+ lprocfs_counter_add(svc_stats, opc + EXTRA_MAX_OPCODES, 0);
}
void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int opc, int bytes)
@@
-460,7
+490,7
@@
void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int opc, int bytes)
svc_stats = req->rq_import->imp_obd->obd_svc_stats;
if (!svc_stats)
return;
- lprocfs_counter_add(svc_stats, opc +
PTLRPC_LAST_CNTR
, bytes);
+ lprocfs_counter_add(svc_stats, opc +
EXTRA_MAX_OPCODES
, bytes);
}
EXPORT_SYMBOL(ptlrpc_lprocfs_brw);
@@
-518,19
+548,20
@@
EXPORT_SYMBOL(lprocfs_wr_evict_client);
int lprocfs_wr_ping(struct file *file, const char *buffer,
unsigned long count, void *data)
{
- struct obd_device *obd = data;
+ struct obd_device
*obd = data;
struct ptlrpc_request *req;
- int rc;
+ int
rc;
ENTRY;
LPROCFS_CLIMP_CHECK(obd);
- req = ptlrpc_prep_req(obd->u.cli.cl_import, LUSTRE_OBD_VERSION,
- OBD_PING, 1, NULL, NULL);
+ req = ptlrpc_request_alloc_pack(obd->u.cli.cl_import, &RQF_OBD_PING,
+ LUSTRE_OBD_VERSION, OBD_PING);
+
LPROCFS_CLIMP_EXIT(obd);
if (req == NULL)
RETURN(-ENOMEM);
- ptlrpc_req
_set_repsize(req, 1, NULL
);
+ ptlrpc_req
uest_set_replen(req
);
req->rq_send_state = LUSTRE_IMP_FULL;
req->rq_no_resend = 1;