@@ -146,26 +146,30 @@ static int mdsc_show(struct seq_file *s, void *p)
146
146
name, total, avg, _min, max, sum); \
147
147
}
148
148
149
- static int metric_show (struct seq_file * s , void * p )
149
+ static int metrics_file_show (struct seq_file * s , void * p )
150
150
{
151
151
struct ceph_fs_client * fsc = s -> private ;
152
- struct ceph_mds_client * mdsc = fsc -> mdsc ;
153
- struct ceph_client_metric * m = & mdsc -> metric ;
154
- int nr_caps = 0 ;
155
- s64 total , sum , avg , min , max , sq ;
156
- u64 sum_sz , avg_sz , min_sz , max_sz ;
152
+ struct ceph_client_metric * m = & fsc -> mdsc -> metric ;
157
153
158
- sum = percpu_counter_sum (& m -> total_inodes );
159
154
seq_printf (s , "item total\n" );
160
155
seq_printf (s , "------------------------------------------\n" );
161
- seq_printf (s , "%-35s%lld / %lld\n" , "opened files / total inodes" ,
162
- atomic64_read (& m -> opened_files ), sum );
163
- seq_printf (s , "%-35s%lld / %lld\n" , "pinned i_caps / total inodes" ,
164
- atomic64_read (& m -> total_caps ), sum );
165
- seq_printf (s , "%-35s%lld / %lld\n" , "opened inodes / total inodes" ,
166
- percpu_counter_sum (& m -> opened_inodes ), sum );
167
-
168
- seq_printf (s , "\n" );
156
+ seq_printf (s , "%-35s%lld\n" , "total inodes" ,
157
+ percpu_counter_sum (& m -> total_inodes ));
158
+ seq_printf (s , "%-35s%lld\n" , "opened files" ,
159
+ atomic64_read (& m -> opened_files ));
160
+ seq_printf (s , "%-35s%lld\n" , "pinned i_caps" ,
161
+ atomic64_read (& m -> total_caps ));
162
+ seq_printf (s , "%-35s%lld\n" , "opened inodes" ,
163
+ percpu_counter_sum (& m -> opened_inodes ));
164
+ return 0 ;
165
+ }
166
+
167
+ static int metrics_latency_show (struct seq_file * s , void * p )
168
+ {
169
+ struct ceph_fs_client * fsc = s -> private ;
170
+ struct ceph_client_metric * m = & fsc -> mdsc -> metric ;
171
+ s64 total , sum , avg , min , max , sq ;
172
+
169
173
seq_printf (s , "item total avg_lat(us) min_lat(us) max_lat(us) stdev(us)\n" );
170
174
seq_printf (s , "-----------------------------------------------------------------------------------\n" );
171
175
@@ -199,7 +203,16 @@ static int metric_show(struct seq_file *s, void *p)
199
203
spin_unlock (& m -> metadata_metric_lock );
200
204
CEPH_LAT_METRIC_SHOW ("metadata" , total , avg , min , max , sq );
201
205
202
- seq_printf (s , "\n" );
206
+ return 0 ;
207
+ }
208
+
209
+ static int metrics_size_show (struct seq_file * s , void * p )
210
+ {
211
+ struct ceph_fs_client * fsc = s -> private ;
212
+ struct ceph_client_metric * m = & fsc -> mdsc -> metric ;
213
+ s64 total ;
214
+ u64 sum_sz , avg_sz , min_sz , max_sz ;
215
+
203
216
seq_printf (s , "item total avg_sz(bytes) min_sz(bytes) max_sz(bytes) total_sz(bytes)\n" );
204
217
seq_printf (s , "----------------------------------------------------------------------------------------\n" );
205
218
@@ -221,7 +234,15 @@ static int metric_show(struct seq_file *s, void *p)
221
234
spin_unlock (& m -> write_metric_lock );
222
235
CEPH_SZ_METRIC_SHOW ("write" , total , avg_sz , min_sz , max_sz , sum_sz );
223
236
224
- seq_printf (s , "\n" );
237
+ return 0 ;
238
+ }
239
+
240
+ static int metrics_caps_show (struct seq_file * s , void * p )
241
+ {
242
+ struct ceph_fs_client * fsc = s -> private ;
243
+ struct ceph_client_metric * m = & fsc -> mdsc -> metric ;
244
+ int nr_caps = 0 ;
245
+
225
246
seq_printf (s , "item total miss hit\n" );
226
247
seq_printf (s , "-------------------------------------------------\n" );
227
248
@@ -350,8 +371,11 @@ DEFINE_SHOW_ATTRIBUTE(mdsmap);
350
371
DEFINE_SHOW_ATTRIBUTE (mdsc );
351
372
DEFINE_SHOW_ATTRIBUTE (caps );
352
373
DEFINE_SHOW_ATTRIBUTE (mds_sessions );
353
- DEFINE_SHOW_ATTRIBUTE (metric );
354
374
DEFINE_SHOW_ATTRIBUTE (status );
375
+ DEFINE_SHOW_ATTRIBUTE (metrics_file );
376
+ DEFINE_SHOW_ATTRIBUTE (metrics_latency );
377
+ DEFINE_SHOW_ATTRIBUTE (metrics_size );
378
+ DEFINE_SHOW_ATTRIBUTE (metrics_caps );
355
379
356
380
357
381
/*
@@ -385,8 +409,9 @@ void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
385
409
debugfs_remove (fsc -> debugfs_mdsmap );
386
410
debugfs_remove (fsc -> debugfs_mds_sessions );
387
411
debugfs_remove (fsc -> debugfs_caps );
388
- debugfs_remove (fsc -> debugfs_metric );
412
+ debugfs_remove (fsc -> debugfs_status );
389
413
debugfs_remove (fsc -> debugfs_mdsc );
414
+ debugfs_remove_recursive (fsc -> debugfs_metrics_dir );
390
415
}
391
416
392
417
void ceph_fs_debugfs_init (struct ceph_fs_client * fsc )
@@ -426,12 +451,6 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
426
451
fsc ,
427
452
& mdsc_fops );
428
453
429
- fsc -> debugfs_metric = debugfs_create_file ("metrics" ,
430
- 0400 ,
431
- fsc -> client -> debugfs_dir ,
432
- fsc ,
433
- & metric_fops );
434
-
435
454
fsc -> debugfs_caps = debugfs_create_file ("caps" ,
436
455
0400 ,
437
456
fsc -> client -> debugfs_dir ,
@@ -443,6 +462,18 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
443
462
fsc -> client -> debugfs_dir ,
444
463
fsc ,
445
464
& status_fops );
465
+
466
+ fsc -> debugfs_metrics_dir = debugfs_create_dir ("metrics" ,
467
+ fsc -> client -> debugfs_dir );
468
+
469
+ debugfs_create_file ("file" , 0400 , fsc -> debugfs_metrics_dir , fsc ,
470
+ & metrics_file_fops );
471
+ debugfs_create_file ("latency" , 0400 , fsc -> debugfs_metrics_dir , fsc ,
472
+ & metrics_latency_fops );
473
+ debugfs_create_file ("size" , 0400 , fsc -> debugfs_metrics_dir , fsc ,
474
+ & metrics_size_fops );
475
+ debugfs_create_file ("caps" , 0400 , fsc -> debugfs_metrics_dir , fsc ,
476
+ & metrics_caps_fops );
446
477
}
447
478
448
479
0 commit comments