create_profiler (const char *args, const char *filename, GPtrArray *filters)
{
char *nf;
- int force_delete = 0;
log_profiler = (MonoProfiler *) g_calloc (1, sizeof (MonoProfiler));
log_profiler->args = pstrdup (args);
log_profiler->command_port = command_port;
- if (filename && *filename == '-') {
- force_delete = 1;
- filename++;
- g_warning ("WARNING: the output:-FILENAME option is deprecated, the profiler now always overrides the output file\n");
- }
-
//If filename begin with +, append the pid at the end
if (filename && *filename == '+')
filename = g_strdup_printf ("%s.%d", filename + 1, getpid ());
-
if (!filename) {
if (do_report)
filename = "|mprof-report -";
} else if (*nf == '#') {
int fd = strtol (nf + 1, NULL, 10);
log_profiler->file = fdopen (fd, "a");
- } else {
- if (force_delete)
- unlink (nf);
+ } else
log_profiler->file = fopen (nf, "wb");
- }
+
if (!log_profiler->file) {
fprintf (stderr, "Cannot create profiler output: %s\n", nf);
exit (1);
report_errors ();
}
# test heapshot traces
-$report = run_test_sgen ("test-heapshot.exe", "heapshot,output=-traces.mlpd,legacy", "--traces traces.mlpd");
+$report = run_test_sgen ("test-heapshot.exe", "heapshot,output=traces.mlpd,legacy", "--traces traces.mlpd");
if ($report ne "missing binary") {
check_report_basics ($report);
check_report_heapshot ($report, 0, {"T" => 5000});
report_errors ();
}
# test traces
-$report = run_test ("test-traces.exe", "legacy,calls,alloc,output=-traces.mlpd", "--maxframes=7 --traces traces.mlpd");
+$report = run_test ("test-traces.exe", "legacy,calls,alloc,output=traces.mlpd", "--maxframes=7 --traces traces.mlpd");
check_report_basics ($report);
check_call_traces ($report,
"T:level3 (int)" => [2020, "T:Main (string[])"],
);
report_errors ();
# test traces without enter/leave events
-$report = run_test ("test-traces.exe", "legacy,alloc,output=-traces.mlpd", "--traces traces.mlpd");
+$report = run_test ("test-traces.exe", "legacy,alloc,output=traces.mlpd", "--traces traces.mlpd");
check_report_basics ($report);
# this has been broken recently
check_exception_traces ($report,