|
@@ -612,6 +612,17 @@ static size_t output__fprintf(FILE *fp, uint64_t total_samples)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void register_idle_thread(void)
|
|
|
|
+{
|
|
|
|
+ struct thread *thread = threads__findnew(0);
|
|
|
|
+
|
|
|
|
+ if (thread == NULL ||
|
|
|
|
+ thread__set_comm(thread, "[idle]")) {
|
|
|
|
+ fprintf(stderr, "problem inserting idle task.\n");
|
|
|
|
+ exit(-1);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
static int __cmd_report(void)
|
|
static int __cmd_report(void)
|
|
{
|
|
{
|
|
@@ -626,6 +637,8 @@ static int __cmd_report(void)
|
|
char cwd[PATH_MAX], *cwdp = cwd;
|
|
char cwd[PATH_MAX], *cwdp = cwd;
|
|
int cwdlen;
|
|
int cwdlen;
|
|
|
|
|
|
|
|
+ register_idle_thread();
|
|
|
|
+
|
|
input = open(input_name, O_RDONLY);
|
|
input = open(input_name, O_RDONLY);
|
|
if (input < 0) {
|
|
if (input < 0) {
|
|
perror("failed to open file");
|
|
perror("failed to open file");
|