|
@@ -503,13 +503,16 @@ static int flush_sample_queue(struct perf_session *s,
|
|
|
struct perf_sample sample;
|
|
|
u64 limit = os->next_flush;
|
|
|
u64 last_ts = os->last_sample ? os->last_sample->timestamp : 0ULL;
|
|
|
- unsigned idx = 0, progress_next = os->nr_samples / 16;
|
|
|
bool show_progress = limit == ULLONG_MAX;
|
|
|
+ struct ui_progress prog;
|
|
|
int ret;
|
|
|
|
|
|
if (!tool->ordered_samples || !limit)
|
|
|
return 0;
|
|
|
|
|
|
+ if (show_progress)
|
|
|
+ ui_progress__init(&prog, os->nr_samples, "Processing time ordered events...");
|
|
|
+
|
|
|
list_for_each_entry_safe(iter, tmp, head, list) {
|
|
|
if (session_done())
|
|
|
return 0;
|
|
@@ -530,11 +533,9 @@ static int flush_sample_queue(struct perf_session *s,
|
|
|
os->last_flush = iter->timestamp;
|
|
|
list_del(&iter->list);
|
|
|
list_add(&iter->list, &os->sample_cache);
|
|
|
- if (show_progress && (++idx >= progress_next)) {
|
|
|
- progress_next += os->nr_samples / 16;
|
|
|
- ui_progress__update(idx, os->nr_samples,
|
|
|
- "Processing time ordered events...");
|
|
|
- }
|
|
|
+
|
|
|
+ if (show_progress)
|
|
|
+ ui_progress__update(&prog, 1);
|
|
|
}
|
|
|
|
|
|
if (list_empty(head)) {
|
|
@@ -1285,12 +1286,13 @@ int __perf_session__process_events(struct perf_session *session,
|
|
|
u64 file_size, struct perf_tool *tool)
|
|
|
{
|
|
|
int fd = perf_data_file__fd(session->file);
|
|
|
- u64 head, page_offset, file_offset, file_pos, progress_next;
|
|
|
+ u64 head, page_offset, file_offset, file_pos;
|
|
|
int err, mmap_prot, mmap_flags, map_idx = 0;
|
|
|
size_t mmap_size;
|
|
|
char *buf, *mmaps[NUM_MMAPS];
|
|
|
union perf_event *event;
|
|
|
uint32_t size;
|
|
|
+ struct ui_progress prog;
|
|
|
|
|
|
perf_tool__fill_defaults(tool);
|
|
|
|
|
@@ -1301,7 +1303,7 @@ int __perf_session__process_events(struct perf_session *session,
|
|
|
if (data_size && (data_offset + data_size < file_size))
|
|
|
file_size = data_offset + data_size;
|
|
|
|
|
|
- progress_next = file_size / 16;
|
|
|
+ ui_progress__init(&prog, file_size, "Processing events...");
|
|
|
|
|
|
mmap_size = MMAP_SIZE;
|
|
|
if (mmap_size > file_size)
|
|
@@ -1356,11 +1358,7 @@ more:
|
|
|
head += size;
|
|
|
file_pos += size;
|
|
|
|
|
|
- if (file_pos >= progress_next) {
|
|
|
- progress_next += file_size / 16;
|
|
|
- ui_progress__update(file_pos, file_size,
|
|
|
- "Processing events...");
|
|
|
- }
|
|
|
+ ui_progress__update(&prog, size);
|
|
|
|
|
|
if (session_done())
|
|
|
goto out;
|