Merge pull request #3234 from tritao/zip_non_seekable_streams
[mono.git] / mono / profiler / decode.c
index e57211635ee700b0ea1bea48015d8709333b89fd..e8d53afea686ed76588370c99fe74beac2c0718b 100644 (file)
@@ -6,6 +6,7 @@
  *   Alex Rønne Petersen (alexrp@xamarin.com)
  *
  * Copyright 2010 Novell, Inc (http://www.novell.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 /*
@@ -353,6 +354,7 @@ section_name (int section)
        case MONO_COUNTER_SECURITY: return "Mono Security";
        case MONO_COUNTER_RUNTIME: return "Mono Runtime";
        case MONO_COUNTER_SYSTEM: return "Mono System";
+       case MONO_COUNTER_PROFILER: return "Mono Profiler";
        default: return "<unknown>";
        }
 }
@@ -2255,8 +2257,6 @@ decode_buffer (ProfContext *ctx)
                        time_from += startup_time;
                        time_to += startup_time;
                }
-               if (!thread->name)
-                       thread->name = pstrdup ("Main");
        }
        for (i = 0; i < thread->stack_id; ++i)
                thread->stack [i]->recurse_count++;
@@ -3151,7 +3151,9 @@ dump_threads (ProfContext *ctx)
        ThreadContext *thread;
        fprintf (outfile, "\nThread summary\n");
        for (thread = ctx->threads; thread; thread = thread->next) {
-               fprintf (outfile, "\tThread: %p, name: \"%s\"\n", (void*)thread->thread_id, thread->name? thread->name: "");
+               if (thread->thread_id) {
+                       fprintf (outfile, "\tThread: %p, name: \"%s\"\n", (void*)thread->thread_id, thread->name? thread->name: "");
+               }
        }
 }