提交 8e8b7d45 编写于 作者: J Jiri Olsa 提交者: Xie XiuQi

perf ordered_events: Rework show_progress for __ordered_events__flush

mainline inclusion
from mainline-5.0-rc1
commit b8494f1df875abba925374cf31bd96a464a7e5d1
category: bugfix
bugzilla: NA
CVE: NA

-------------------------------------------------
Decide to use the progress bar one level higher, we will need this in
following patch.
Signed-off-by: NJiri Olsa <jolsa@kernel.org>
Acked-by: NDavid S. Miller <davem@davemloft.net>
Acked-by: NNamhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-ocjdukp2a8ujikkmafd0j5zv@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: NChunmei Xu <xuchunmei@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 df0d87ea
...@@ -185,13 +185,13 @@ int ordered_events__queue(struct ordered_events *oe, union perf_event *event, ...@@ -185,13 +185,13 @@ int ordered_events__queue(struct ordered_events *oe, union perf_event *event,
return 0; return 0;
} }
static int __ordered_events__flush(struct ordered_events *oe) static int __ordered_events__flush(struct ordered_events *oe,
bool show_progress)
{ {
struct list_head *head = &oe->events; struct list_head *head = &oe->events;
struct ordered_event *tmp, *iter; struct ordered_event *tmp, *iter;
u64 limit = oe->next_flush; u64 limit = oe->next_flush;
u64 last_ts = oe->last ? oe->last->timestamp : 0ULL; u64 last_ts = oe->last ? oe->last->timestamp : 0ULL;
bool show_progress = limit == ULLONG_MAX;
struct ui_progress prog; struct ui_progress prog;
int ret; int ret;
...@@ -238,6 +238,7 @@ int ordered_events__flush(struct ordered_events *oe, enum oe_flush how) ...@@ -238,6 +238,7 @@ int ordered_events__flush(struct ordered_events *oe, enum oe_flush how)
"HALF ", "HALF ",
}; };
int err; int err;
bool show_progress = false;
if (oe->nr_events == 0) if (oe->nr_events == 0)
return 0; return 0;
...@@ -245,6 +246,7 @@ int ordered_events__flush(struct ordered_events *oe, enum oe_flush how) ...@@ -245,6 +246,7 @@ int ordered_events__flush(struct ordered_events *oe, enum oe_flush how)
switch (how) { switch (how) {
case OE_FLUSH__FINAL: case OE_FLUSH__FINAL:
oe->next_flush = ULLONG_MAX; oe->next_flush = ULLONG_MAX;
show_progress = true;
break; break;
case OE_FLUSH__HALF: case OE_FLUSH__HALF:
...@@ -274,7 +276,7 @@ int ordered_events__flush(struct ordered_events *oe, enum oe_flush how) ...@@ -274,7 +276,7 @@ int ordered_events__flush(struct ordered_events *oe, enum oe_flush how)
str[how], oe->nr_events); str[how], oe->nr_events);
pr_oe_time(oe->max_timestamp, "max_timestamp\n"); pr_oe_time(oe->max_timestamp, "max_timestamp\n");
err = __ordered_events__flush(oe); err = __ordered_events__flush(oe, show_progress);
if (!err) { if (!err) {
if (how == OE_FLUSH__ROUND) if (how == OE_FLUSH__ROUND)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册