From f475cd240ad00ae08f7a174db7f5dde1fe937294 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sat, 23 Mar 2019 12:13:08 +0100 Subject: [PATCH] sadf: PCP: Define domain constants Signed-off-by: Sebastien GODARD --- pcp_def_metrics.c | 7 ++++--- pcp_def_metrics.h | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pcp_def_metrics.c b/pcp_def_metrics.c index 1f9ec3c..609c43b 100644 --- a/pcp_def_metrics.c +++ b/pcp_def_metrics.c @@ -21,6 +21,7 @@ #include "common.h" #include "sa.h" +#include "pcp_def_metrics.h" #ifdef HAVE_PCP #include @@ -97,7 +98,7 @@ void pcp_def_cpu_metrics(struct activity *a) } else { if (i == 1) { - indom = pmInDom_build(0, 0); + indom = pmInDom_build(0, PM_INDOM_CPU); pmiAddMetric("kernel.percpu.cpu.user", PM_IN_NULL, PM_TYPE_FLOAT, indom, PM_SEM_INSTANT, @@ -435,7 +436,7 @@ void pcp_def_queue_metrics(void) PM_IN_NULL, PM_TYPE_U64, PM_INDOM_NULL, PM_SEM_INSTANT, pmiUnits(0, 0, 1, 0, 0, PM_COUNT_ONE)); - indom = pmInDom_build(0, 1); + indom = pmInDom_build(0, PM_INDOM_QUEUE); pmiAddMetric("kernel.all.load", PM_IN_NULL, PM_TYPE_FLOAT, indom, PM_SEM_INSTANT, pmiUnits(0, 0, 0, 0, 0, 0)); @@ -462,7 +463,7 @@ void pcp_def_net_dev_metrics(struct activity *a) if (indom == PM_INDOM_NULL) { /* Create domain */ - indom = pmInDom_build(0, 2); + indom = pmInDom_build(0, PM_INDOM_NET_DEV); /* Create instances */ while (list != NULL) { diff --git a/pcp_def_metrics.h b/pcp_def_metrics.h index 238a23a..4516cdb 100644 --- a/pcp_def_metrics.h +++ b/pcp_def_metrics.h @@ -23,4 +23,10 @@ void pcp_def_ktables_metrics(void); void pcp_def_queue_metrics(void); void pcp_def_net_dev_metrics(struct activity *); +/* Define domains number */ +#define PM_INDOM_CPU 0 +#define PM_INDOM_QUEUE 1 +#define PM_INDOM_NET_DEV 2 + + #endif /* _PCP_DEF_METRICS_H */ -- 2.40.0