Re: [PATCH 1/2] blk-iocost: Add iocg idle state tracepoint

2020-12-17 Thread Jens Axboe
On 12/17/20 12:57 AM, Baolin Wang wrote:
> Hi Jens,
> 
>> It will be helpful to trace the iocg's whole state, including active and
>> idle state. And we can easily expand the original iocost_iocg_activate
>> trace event to support a state trace class, including active and idle
>> state tracing.
>>
>> Signed-off-by: Baolin Wang 
> 
> Could you pick up patch 1 which was already acked by Tejun. Thanks.

Done, thanks.

-- 
Jens Axboe



Re: [PATCH 1/2] blk-iocost: Add iocg idle state tracepoint

2020-12-16 Thread Baolin Wang

Hi Jens,


It will be helpful to trace the iocg's whole state, including active and
idle state. And we can easily expand the original iocost_iocg_activate
trace event to support a state trace class, including active and idle
state tracing.

Signed-off-by: Baolin Wang 


Could you pick up patch 1 which was already acked by Tejun. Thanks.


---
  block/blk-iocost.c|  3 +++
  include/trace/events/iocost.h | 16 +++-
  2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index ffa418c..ac6078a 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -2185,6 +2185,9 @@ static int ioc_check_iocgs(struct ioc *ioc, struct 
ioc_now *now)
WEIGHT_ONE);
}
  
+			TRACE_IOCG_PATH(iocg_idle, iocg, now,

+   atomic64_read(&iocg->active_period),
+   atomic64_read(&ioc->cur_period), vtime);
__propagate_weights(iocg, 0, 0, false, now);
list_del_init(&iocg->active_list);
}
diff --git a/include/trace/events/iocost.h b/include/trace/events/iocost.h
index 0b68699..e282ce0 100644
--- a/include/trace/events/iocost.h
+++ b/include/trace/events/iocost.h
@@ -11,7 +11,7 @@
  
  #include 
  
-TRACE_EVENT(iocost_iocg_activate,

+DECLARE_EVENT_CLASS(iocost_iocg_state,
  
  	TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now,

u64 last_period, u64 cur_period, u64 vtime),
@@ -59,6 +59,20 @@
)
  );
  
+DEFINE_EVENT(iocost_iocg_state, iocost_iocg_activate,

+   TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now,
+u64 last_period, u64 cur_period, u64 vtime),
+
+   TP_ARGS(iocg, path, now, last_period, cur_period, vtime)
+);
+
+DEFINE_EVENT(iocost_iocg_state, iocost_iocg_idle,
+   TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now,
+u64 last_period, u64 cur_period, u64 vtime),
+
+   TP_ARGS(iocg, path, now, last_period, cur_period, vtime)
+);
+
  DECLARE_EVENT_CLASS(iocg_inuse_update,
  
  	TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now,




Re: [PATCH 1/2] blk-iocost: Add iocg idle state tracepoint

2020-12-10 Thread Tejun Heo
On Thu, Dec 10, 2020 at 06:56:44PM +0800, Baolin Wang wrote:
> It will be helpful to trace the iocg's whole state, including active and
> idle state. And we can easily expand the original iocost_iocg_activate
> trace event to support a state trace class, including active and idle
> state tracing.
> 
> Signed-off-by: Baolin Wang 

Acked-by: Tejun Heo 

Thanks.

-- 
tejun


[PATCH 1/2] blk-iocost: Add iocg idle state tracepoint

2020-12-10 Thread Baolin Wang
It will be helpful to trace the iocg's whole state, including active and
idle state. And we can easily expand the original iocost_iocg_activate
trace event to support a state trace class, including active and idle
state tracing.

Signed-off-by: Baolin Wang 
---
 block/blk-iocost.c|  3 +++
 include/trace/events/iocost.h | 16 +++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index ffa418c..ac6078a 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -2185,6 +2185,9 @@ static int ioc_check_iocgs(struct ioc *ioc, struct 
ioc_now *now)
WEIGHT_ONE);
}
 
+   TRACE_IOCG_PATH(iocg_idle, iocg, now,
+   atomic64_read(&iocg->active_period),
+   atomic64_read(&ioc->cur_period), vtime);
__propagate_weights(iocg, 0, 0, false, now);
list_del_init(&iocg->active_list);
}
diff --git a/include/trace/events/iocost.h b/include/trace/events/iocost.h
index 0b68699..e282ce0 100644
--- a/include/trace/events/iocost.h
+++ b/include/trace/events/iocost.h
@@ -11,7 +11,7 @@
 
 #include 
 
-TRACE_EVENT(iocost_iocg_activate,
+DECLARE_EVENT_CLASS(iocost_iocg_state,
 
TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now,
u64 last_period, u64 cur_period, u64 vtime),
@@ -59,6 +59,20 @@
)
 );
 
+DEFINE_EVENT(iocost_iocg_state, iocost_iocg_activate,
+   TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now,
+u64 last_period, u64 cur_period, u64 vtime),
+
+   TP_ARGS(iocg, path, now, last_period, cur_period, vtime)
+);
+
+DEFINE_EVENT(iocost_iocg_state, iocost_iocg_idle,
+   TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now,
+u64 last_period, u64 cur_period, u64 vtime),
+
+   TP_ARGS(iocg, path, now, last_period, cur_period, vtime)
+);
+
 DECLARE_EVENT_CLASS(iocg_inuse_update,
 
TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now,
-- 
1.8.3.1