| 1610 | } |
| 1611 | |
| 1612 | Error Profiler::run(Arguments& args) { |
| 1613 | if (!args.hasOutputFile()) { |
| 1614 | LogWriter out; |
| 1615 | return runInternal(args, out); |
| 1616 | } else { |
| 1617 | // Open output file under the lock to avoid races with background timer |
| 1618 | MutexLocker ml(_state_lock); |
| 1619 | FileWriter out(args.file()); |
| 1620 | if (!out.is_open()) { |
| 1621 | return Error("Could not open output file"); |
| 1622 | } |
| 1623 | return runInternal(args, out); |
| 1624 | } |
| 1625 | } |
| 1626 | |
| 1627 | Error Profiler::expire(Arguments& args, bool restart) { |
| 1628 | MutexLocker ml(_state_lock); |
no test coverage detected