Motr  M0
stats_srv.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
177 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_STATS
178 #include "lib/trace.h"
179 #include "lib/tlist.h"
180 #include "lib/assert.h"
181 #include "lib/misc.h"
182 #include "lib/memory.h"
183 #include "rpc/item.h"
184 #include "fop/fop_item_type.h"
185 #include "rpc/rpc_opcodes.h"
186 #include "stats/stats_srv.h"
187 #include "fop/fop.h"
188 #include "fop/fom_generic.h"
189 #include "reqh/reqh_service.h"
190 #include "stats/stats_fops.h"
191 #include "stats/stats_fops_xc.h"
192 
193 M0_TL_DESCR_DEFINE(stats, "statistic objects", M0_INTERNAL, struct m0_stats,
194  s_linkage, s_magic, M0_STATS_MAGIC, M0_STATS_HEAD_MAGIC);
195 M0_TL_DEFINE(stats, M0_INTERNAL, struct m0_stats);
196 
197 static const struct m0_bob_type stats_svc_bob = {
198  .bt_name = "stats svc",
199  .bt_magix_offset = M0_MAGIX_OFFSET(struct stats_svc, ss_magic),
200  .bt_magix = M0_STATS_SVC_MAGIC,
201  .bt_check = NULL
202 };
203 
205 
210 
211 #define SUM_DATA_SIZE(sum_data) (sum_data->ss_data.se_nr * sizeof(uint64_t))
212 
213 /*
214  * Stats Service
215  */
216 static bool stats_svc_invariant(const struct stats_svc *svc)
217 {
218  return stats_svc_bob_check(svc);
219 }
220 
225 {
227  return 0;
228 }
229 
234 {
236 }
237 
242 {
243  struct stats_svc *svc;
244  struct m0_stats *stats_obj;
245 
247  M0_RST_FAILED)));
248  svc = bob_of(service, struct stats_svc, ss_reqhs, &stats_svc_bob);
249 
250  m0_tl_for(stats, &svc->ss_stats, stats_obj) {
251  M0_ASSERT(stats_obj != NULL);
252 
253  stats_tlink_del_fini(stats_obj);
254  m0_free(stats_obj->s_sum.ss_data.se_data);
255  m0_free(stats_obj);
256  } m0_tl_endfor;
257 
258  stats_svc_bob_fini(svc);
259  m0_free(svc);
260 }
261 
262 static const struct m0_reqh_service_ops stats_svc_ops = {
264  .rso_start_async = m0_reqh_service_async_start_simple,
265  .rso_stop = stats_svc_rso_stop,
266  .rso_fini = stats_svc_rso_fini
267 };
268 
269 static int
271  const struct m0_reqh_service_type *stype)
272 {
273  struct stats_svc *svc;
274 
275  M0_PRE(srv != NULL && stype != NULL);
276 
277  M0_ALLOC_PTR(svc);
278  if (svc == NULL)
279  return M0_ERR_INFO(-ENOMEM, "Failed to allocate memory.");
280 
281  *srv = &svc->ss_reqhs;
282  (*srv)->rs_type = stype;
283  (*srv)->rs_ops = &stats_svc_ops;
284 
285  stats_svc_bob_init(svc);
286  stats_tlist_init(&svc->ss_stats);
287 
289 
290  return 0;
291 }
292 
295 };
296 
298  .rst_name = "M0_CST_STATS",
299  .rst_ops = &stats_service_type_ops,
300  .rst_level = M0_RS_LEVEL_NORMAL,
301  .rst_typecode = M0_CST_STATS,
302 };
303 
304 /*
305  * Public interfaces
306  */
307 M0_INTERNAL int m0_stats_svc_init(void)
308 {
310 
311 }
312 
313 M0_INTERNAL void m0_stats_svc_fini(void)
314 {
316 }
317 
318 /*
319  * Stats Update FOM.
320  */
321 static int stats_update_fom_create(struct m0_fop *fop, struct m0_fom **out,
322  struct m0_reqh *reqh);
323 static int stats_update_fom_tick(struct m0_fom *fom);
324 static void stats_update_fom_fini(struct m0_fom *fom);
325 static size_t stats_fom_home_locality(const struct m0_fom *fom);
326 
332  .fo_home_locality = stats_fom_home_locality,
333  .fo_fini = stats_update_fom_fini
334 };
335 
341 };
342 
346  .sd_name = "Init",
348  },
350  .sd_name = "Update",
351  .sd_allowed = M0_BITS(STATS_UPDATE_FOM_FINISH)
352  },
354  .sd_flags = M0_SDF_TERMINAL,
355  .sd_name = "Finish",
356  .sd_allowed = 0
357  },
358 };
359 
361  .scf_name = "stats-update-fom-sm",
362  .scf_nr_states = ARRAY_SIZE(stats_update_phases),
363  .scf_state = stats_update_phases
364 };
365 
366 static bool stats_invariant(const struct m0_stats *stats)
367 {
368  return stats->s_magic == M0_STATS_MAGIC;
369 }
370 
371 M0_INTERNAL struct m0_stats *m0_stats_get(struct m0_tl *stats_list, uint64_t id)
372 {
373  M0_PRE(stats_list != NULL);
374 
375  return m0_tl_find(stats, stats_obj, stats_list,
376  (M0_ASSERT(stats_invariant(stats_obj)),
377  stats_obj->s_sum.ss_id == id));
378 }
379 
380 static int stats_sum_copy(struct m0_stats_sum *s, struct m0_stats_sum *d)
381 {
382  M0_PRE(s != NULL && d != NULL);
383  if (d->ss_data.se_data == 0) {
384  M0_ALLOC_ARR(d->ss_data.se_data, s->ss_data.se_nr);
385  if (d->ss_data.se_data == NULL)
386  return M0_ERR(-ENOMEM);
387  }
388  d->ss_id = s->ss_id;
389  d->ss_data.se_data = s->ss_data.se_data;
390  memcpy(d->ss_data.se_data, s->ss_data.se_data, SUM_DATA_SIZE(d));
391  return 0;
392 }
393 
394 static int stats_add(struct m0_tl *stats_list, struct m0_stats_sum *sum)
395 {
396  struct m0_stats *new_stats;
397  int rc;
398 
399  M0_PRE(stats_list != NULL);
400  M0_PRE(sum != NULL);
401 
408  M0_ALLOC_PTR(new_stats);
409  if (new_stats == NULL)
410  return M0_ERR_INFO(-ENOMEM, "Failed to allocate memory.");
411 
412  new_stats->s_magic = M0_STATS_MAGIC;
413  rc = stats_sum_copy(sum, &new_stats->s_sum);
414  if (rc != 0) {
415  m0_free(new_stats);
416  return M0_RC(rc);
417  }
418 
419  stats_tlink_init(new_stats);
420  stats_tlist_add_tail(stats_list, new_stats);
421 
422  return 0;
423 }
424 
425 static int stats_update(struct m0_fom *fom)
426 {
427  struct m0_stats_update_fop *ufop;
428  struct stats_svc *svc;
429  int i;
430 
431  M0_PRE(fom != NULL);
432 
433  ufop = m0_stats_update_fop_get(fom->fo_fop);
434 
435  svc = container_of(fom->fo_service, struct stats_svc, ss_reqhs);
437 
438  for (i = 0; i < ufop->suf_stats.sf_nr; ++i) {
439  struct m0_stats_sum *sum = &(ufop->suf_stats.sf_stats[i]);
440  struct m0_stats *stats_obj = m0_stats_get(&svc->ss_stats,
441  sum->ss_id);
442 
443  if (stats_obj != NULL) {
444  stats_sum_copy(sum, &stats_obj->s_sum);
445  } else {
446  int rc = stats_add(&svc->ss_stats, sum);
447  if (rc != 0)
448  return M0_RC(rc);
449  }
450  }
451 
452  return 0;
453 }
454 
458 static int stats_update_fom_create(struct m0_fop *fop, struct m0_fom **out,
459  struct m0_reqh *reqh)
460 {
461  struct stats_update_fom *stats_ufom;
462  struct m0_fom *fom;
463 
464  M0_PRE(fop != NULL);
465  M0_PRE(out != NULL);
466 
467  M0_ALLOC_PTR(stats_ufom);
468  if (stats_ufom == NULL)
469  return M0_ERR_INFO(-ENOMEM, "Failed to allocate memory.");
470 
471  fom = &stats_ufom->suf_fom;
473  fop, NULL, reqh);
474 
475  stats_ufom->suf_magic = M0_STATS_UPDATE_FOM_MAGIC;
476 
477  *out = fom;
478 
479  return 0;
480 }
481 
485 static int stats_update_fom_tick(struct m0_fom *fom)
486 {
487  int rc = 0;
488 
489  M0_PRE(fom != NULL);
490 
491  switch (m0_fom_phase(fom)) {
494  rc = M0_FSO_AGAIN;
495  break;
497  rc = stats_update(fom);
499  /* No need to execute generic phases. */
500  rc = M0_FSO_WAIT;
501  break;
502  default:
503  M0_IMPOSSIBLE("Bad phase.");
504  }
505 
506  return M0_RC(rc);
507 }
508 
512 static void stats_update_fom_fini(struct m0_fom *fom)
513 {
514  struct stats_update_fom *ufom;
515 
516  M0_PRE(fom != NULL);
517  ufom = container_of(fom, struct stats_update_fom, suf_fom);
518 
519  m0_fom_fini(fom);
520  m0_free(ufom);
521 }
522 
526 static size_t stats_fom_home_locality(const struct m0_fom *fom)
527 {
528  return 1; /* all stats update FOM run in same locality */
529 }
530 
531 /*
532  * Stats Query FOM
533  */
534 static int stats_query_fom_create(struct m0_fop *fop, struct m0_fom **out,
535  struct m0_reqh *reqh);
536 static int stats_query_fom_tick(struct m0_fom *fom);
537 static void stats_query_fom_fini(struct m0_fom *fom);
538 
542 static const struct m0_fom_ops stats_query_fom_ops = {
544  .fo_home_locality = stats_fom_home_locality,
545  .fo_fini = stats_query_fom_fini
546 };
547 
553 };
554 
557  .sd_name = "Read",
558  .sd_allowed = M0_BITS(M0_FOPH_SUCCESS, M0_FOPH_FAILURE)
559  }
560 };
561 
563  .scf_name = "stats-query-fom-sm",
564  .scf_nr_states = ARRAY_SIZE(stats_query_phases),
565  .scf_state = stats_query_phases
566 };
567 
568 static int read_stats(struct m0_fom *fom)
569 {
570  struct m0_stats_query_fop *qfop;
571  struct stats_svc *svc;
573  int i;
574  int rc = 0;
575 
576  M0_PRE(fom != NULL);
577 
578  qfop = m0_stats_query_fop_get(fom->fo_fop);
579  M0_ASSERT(qfop->sqf_ids.se_nr != 0);
580 
581  svc = container_of(fom->fo_service, struct stats_svc, ss_reqhs);
583 
584  rep_fop = m0_stats_query_rep_fop_get(fom->fo_rep_fop);
585  rep_fop->sqrf_stats.sf_nr = qfop->sqf_ids.se_nr;
586 
587  for (i = 0; i < qfop->sqf_ids.se_nr; ++i) {
588  struct m0_stats *stats_obj =
589  m0_stats_get(&svc->ss_stats, qfop->sqf_ids.se_data[i]);
590 
591  /* Continue getting stats for next id */
592  if (stats_obj == NULL) {
593  rep_fop->sqrf_stats.sf_stats[i].ss_data.se_nr = 0;
594  continue;
595  }
596 
597  rc = stats_sum_copy(&stats_obj->s_sum,
598  &rep_fop->sqrf_stats.sf_stats[i]);
599  if (rc != 0) {
600 #undef REP_STATS_SUM_DATA
601 #define REP_STATS_SUM_DATA(rep_fop, i) \
602  (rep_fop->sqrf_stats.sf_stats[i].ss_data.se_data)
603 
604  for (;i >= 0; --i)
606  m0_free(rep_fop->sqrf_stats.sf_stats);
607  break;
608  }
609  }
610 
611  return M0_RC(rc);
612 }
613 
617 static int stats_query_fom_create(struct m0_fop *fop, struct m0_fom **out,
618  struct m0_reqh *reqh)
619 {
620  struct stats_query_fom *stats_qfom;
621  struct m0_fom *fom;
622  struct m0_fop *reply_fop;
623  struct m0_stats_query_rep_fop *qrep_fop;
624  struct m0_stats_query_fop *q_fop;
625  int rc = 0;
626 
627  M0_PRE(fop != NULL);
628  M0_PRE(out != NULL);
629 
630  M0_ALLOC_PTR(stats_qfom);
631  if (stats_qfom == NULL)
632  return M0_ERR_INFO(-ENOMEM, "Failed to allocate memory.");
633 
634  M0_ALLOC_PTR(qrep_fop);
635  if (qrep_fop == NULL) {
636  rc = -ENOMEM;
637  goto free_qfom;
638  }
639 
640  q_fop = m0_stats_query_fop_get(fop);
641  qrep_fop->sqrf_stats.sf_nr = q_fop->sqf_ids.se_nr;
642 
643  M0_ALLOC_ARR(qrep_fop->sqrf_stats.sf_stats, q_fop->sqf_ids.se_nr);
644  if (qrep_fop->sqrf_stats.sf_stats == NULL) {
645  rc = -ENOMEM;
646  goto free_qrep_fop;
647  }
648 
651  if (reply_fop == NULL) {
652  rc = -ENOMEM;
653  goto free_qrep_fop_stats;
654  }
655 
656  fom = &stats_qfom->sqf_fom;
658  reply_fop, reqh);
659 
660  stats_qfom->sqf_magic = M0_STATS_QUERY_FOM_MAGIC;
661 
662  *out = fom;
663 
664  return 0;
665 
666 free_qrep_fop_stats:
667  m0_free(qrep_fop->sqrf_stats.sf_stats);
668 free_qrep_fop:
669  m0_free(qrep_fop);
670 free_qfom:
671  m0_free(stats_qfom);
672 
673  return M0_ERR_INFO(rc, "Failed to create query FOM");
674 }
675 
679 static int stats_query_fom_tick(struct m0_fom *fom)
680 {
681  int rc = 0;
682 
683  M0_PRE(fom != NULL);
684 
689  if (m0_fom_phase(fom) < M0_FOPH_NR)
690  return m0_fom_tick_generic(fom);
691 
692  switch (m0_fom_phase(fom)) {
694  rc = read_stats(fom);
696  rc = M0_FSO_AGAIN;
697  break;
698  default:
699  M0_IMPOSSIBLE("Phase not defined.");
700  }
701 
702  return M0_RC(rc);
703 }
704 
708 static void stats_query_fom_fini(struct m0_fom *fom)
709 {
710  struct stats_query_fom *qfom;
711 
712  M0_PRE(fom != NULL);
713  qfom = container_of(fom, struct stats_query_fom, sqf_fom);
714 
715  m0_fom_fini(fom);
716  m0_free(qfom);
717 }
718 
719 #undef M0_TRACE_SUBSYSTEM
720 
721 /*
722  * Local variables:
723  * c-indentation-style: "K&R"
724  * c-basic-offset: 8
725  * tab-width: 8
726  * fill-column: 80
727  * scroll-step: 1
728  * End:
729  */
M0_INTERNAL int m0_reqh_service_state_get(const struct m0_reqh_service *s)
Definition: reqh_service.c:560
static int stats_svc_rsto_service_allocate(struct m0_reqh_service **srv, const struct m0_reqh_service_type *stype)
Definition: stats_srv.c:270
void m0_fom_phase_moveif(struct m0_fom *fom, int32_t rc, int phase0, int phase1)
Definition: fom.c:1710
#define M0_PRE(cond)
#define M0_ALLOC_ARR(arr, nr)
Definition: memory.h:84
int(* rso_start)(struct m0_reqh_service *service)
Definition: reqh_service.h:360
#define NULL
Definition: misc.h:38
struct m0_sm_state_descr stats_query_phases[]
Definition: stats_srv.c:555
M0_INTERNAL void m0_stats_svc_fini(void)
Definition: stats_srv.c:313
uint32_t ss_id
Definition: stats_fops.h:58
Definition: sm.h:350
int(* fo_tick)(struct m0_fom *fom)
Definition: fom.h:663
struct m0_uint64_seq ss_data
Definition: stats_fops.h:60
M0_TL_DEFINE(stats, M0_INTERNAL, struct m0_stats)
static void stats_query_fom_fini(struct m0_fom *fom)
Definition: stats_srv.c:708
static const struct m0_fom_ops stats_query_fom_ops
Definition: stats_srv.c:542
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: fom.h:650
#define REP_STATS_SUM_DATA(rep_fop, i)
struct m0_stats_recs sqrf_stats
Definition: stats_fops.h:84
static int sum
Definition: rwlock.c:53
#define M0_BITS(...)
Definition: misc.h:236
struct m0_sm_state_descr stats_update_phases[]
Definition: stats_srv.c:343
#define container_of(ptr, type, member)
Definition: misc.h:33
int m0_reqh_service_type_register(struct m0_reqh_service_type *rstype)
Definition: reqh_service.c:473
m0_fom_phase
Definition: fom.h:372
const char * bt_name
Definition: bob.h:73
static int stats_add(struct m0_tl *stats_list, struct m0_stats_sum *sum)
Definition: stats_srv.c:394
struct m0_fom_type ft_fom_type
Definition: fop.h:232
#define m0_tl_endfor
Definition: tlist.h:700
uint64_t * se_data
Definition: stats_fops.h:51
return M0_RC(rc)
struct m0_uint64_seq sqf_ids
Definition: stats_fops.h:78
static const struct m0_reqh_service_type_ops stats_service_type_ops
Definition: stats_srv.c:293
static int stats_update_fom_tick(struct m0_fom *fom)
Definition: stats_srv.c:485
void m0_fom_init(struct m0_fom *fom, const struct m0_fom_type *fom_type, const struct m0_fom_ops *ops, struct m0_fop *fop, struct m0_fop *reply, struct m0_reqh *reqh)
Definition: fom.c:1372
int i
Definition: dir.c:1033
struct m0_fop_type * f_type
Definition: fop.h:81
struct m0_rpc_machine * m0_fop_rpc_machine(const struct m0_fop *fop)
Definition: fop.c:360
#define M0_ERR_INFO(rc, fmt,...)
Definition: trace.h:215
return M0_ERR(-EOPNOTSUPP)
struct m0_fom sqf_fom
Definition: stats_srv.h:123
static void stats_svc_rso_fini(struct m0_reqh_service *service)
Definition: stats_srv.c:241
struct m0_stats_sum s_sum
Definition: stats_srv.h:85
static const struct socktype stype[]
Definition: sock.c:1156
static int stats_update_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: stats_srv.c:458
static int stats_sum_copy(struct m0_stats_sum *s, struct m0_stats_sum *d)
Definition: stats_srv.c:380
int m0_fom_tick_generic(struct m0_fom *fom)
Definition: fom_generic.c:848
void m0_fom_fini(struct m0_fom *fom)
Definition: fom.c:1324
const struct m0_sm_conf stats_update_fom_sm_conf
Definition: stats_srv.c:208
#define M0_ASSERT(cond)
static int stats_query_fom_tick(struct m0_fom *fom)
Definition: stats_srv.c:679
const char * scf_name
Definition: sm.h:352
static int stats_update(struct m0_fom *fom)
Definition: stats_srv.c:425
M0_TL_DESCR_DEFINE(stats, "statistic objects", M0_INTERNAL, struct m0_stats, s_linkage, s_magic, M0_STATS_MAGIC, M0_STATS_HEAD_MAGIC)
const char * rst_name
Definition: reqh_service.h:447
static struct m0_fop reply_fop
Definition: fsync.c:64
Definition: tlist.h:251
#define bob_of(ptr, type, field, bt)
Definition: bob.h:140
struct m0_stats_sum * sf_stats
Definition: stats_fops.h:67
M0_INTERNAL struct m0_stats_query_rep_fop * m0_stats_query_rep_fop_get(struct m0_fop *fop)
Definition: stats_fops.c:114
uint64_t suf_magic
Definition: stats_srv.h:108
static size_t stats_fom_home_locality(const struct m0_fom *fom)
Definition: stats_srv.c:526
#define M0_POST(cond)
uint32_t se_nr
Definition: stats_fops.h:49
Definition: reqh.h:94
M0_BOB_DEFINE(static, &stats_svc_bob, stats_svc)
Definition: dump.c:103
M0_INTERNAL struct m0_stats_query_fop * m0_stats_query_fop_get(struct m0_fop *fop)
Definition: stats_fops.c:108
struct m0_fom suf_fom
Definition: stats_srv.h:109
struct m0_stats_recs suf_stats
Definition: stats_fops.h:72
static bool stats_svc_invariant(const struct stats_svc *svc)
Definition: stats_srv.c:216
int m0_reqh_service_async_start_simple(struct m0_reqh_service_start_async_ctx *asc)
Definition: reqh_service.c:601
uint64_t s_magic
Definition: stats_srv.h:81
static int stats_svc_rso_start(struct m0_reqh_service *service)
Definition: stats_srv.c:224
uint32_t sd_flags
Definition: sm.h:378
M0_INTERNAL int m0_stats_svc_init(void)
Definition: stats_srv.c:307
Definition: fom.h:481
struct m0_reqh reqh
Definition: rm_foms.c:48
#define M0_MAGIX_OFFSET(type, field)
Definition: misc.h:356
const char * sd_name
Definition: sm.h:383
struct m0_fom_ops stats_update_fom_ops
Definition: stats_srv.c:330
int(* rsto_service_allocate)(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition: reqh_service.h:435
uint64_t sqf_magic
Definition: stats_srv.h:122
static bool stats_invariant(const struct m0_stats *stats)
Definition: stats_srv.c:366
#define M0_ALLOC_PTR(ptr)
Definition: memory.h:86
Definition: beck.c:130
uint64_t sf_nr
Definition: stats_fops.h:65
static struct m0_net_test_service svc
Definition: service.c:34
struct m0_reqh_service_type m0_stats_svc_type
Definition: stats_srv.c:297
static struct m0_fop * fop
Definition: item.c:57
struct m0_reqh_service ss_reqhs
Definition: stats_srv.h:101
static void stats_svc_rso_stop(struct m0_reqh_service *service)
Definition: stats_srv.c:233
#define SUM_DATA_SIZE(sum_data)
Definition: stats_srv.c:211
const struct m0_fom_type_ops stats_query_fom_type_ops
Definition: stats_srv.c:207
static void stats_update_fom_fini(struct m0_fom *fom)
Definition: stats_srv.c:512
static int read_stats(struct m0_fom *fom)
Definition: stats_srv.c:568
M0_INTERNAL struct m0_stats * m0_stats_get(struct m0_tl *stats_list, uint64_t id)
Definition: stats_srv.c:371
const struct m0_sm_conf stats_query_fom_sm_conf
Definition: stats_srv.c:209
#define out(...)
Definition: gen.c:41
void m0_fom_phase_set(struct m0_fom *fom, int phase)
Definition: fom.c:1688
static const struct m0_bob_type stats_svc_bob
Definition: stats_srv.c:197
#define m0_tl_find(name, var, head,...)
Definition: tlist.h:757
#define m0_tl_for(name, head, obj)
Definition: tlist.h:695
void m0_free(void *data)
Definition: memory.c:146
static struct m0_addb2_source * s
Definition: consumer.c:39
void m0_reqh_service_type_unregister(struct m0_reqh_service_type *rstype)
Definition: reqh_service.c:490
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
Definition: long_lock_ut.c:46
M0_INTERNAL struct m0_stats_update_fop * m0_stats_update_fop_get(struct m0_fop *fop)
Definition: stats_fops.c:102
int32_t rc
Definition: trigger_fop.h:47
#define ARRAY_SIZE(a)
Definition: misc.h:45
static const struct m0_reqh_service_ops stats_svc_ops
Definition: stats_srv.c:262
const struct m0_fom_type_ops stats_update_fom_type_ops
Definition: stats_srv.c:206
Definition: fop.h:79
struct m0_fop_type m0_fop_stats_query_rep_fopt
Definition: stats_fops.c:43
struct m0_fop * rep_fop
Definition: dir.c:334
static struct net_srv srv
Definition: net_test.c:52
static int stats_query_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: stats_srv.c:617
struct m0_fop * m0_fop_alloc(struct m0_fop_type *fopt, void *data, struct m0_rpc_machine *mach)
Definition: fop.c:96
#define M0_IMPOSSIBLE(fmt,...)