OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/trace_event/trace_log.h" | 5 #include "base/trace_event/trace_log.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1602 void TraceLog::SetProcessSortIndex(int sort_index) { | 1602 void TraceLog::SetProcessSortIndex(int sort_index) { |
1603 AutoLock lock(lock_); | 1603 AutoLock lock(lock_); |
1604 process_sort_index_ = sort_index; | 1604 process_sort_index_ = sort_index; |
1605 } | 1605 } |
1606 | 1606 |
1607 void TraceLog::SetProcessName(const std::string& process_name) { | 1607 void TraceLog::SetProcessName(const std::string& process_name) { |
1608 AutoLock lock(lock_); | 1608 AutoLock lock(lock_); |
1609 process_name_ = process_name; | 1609 process_name_ = process_name; |
1610 } | 1610 } |
1611 | 1611 |
| 1612 std::string TraceLog::GetProcessName() { |
| 1613 AutoLock lock(lock_); |
| 1614 return process_name_; |
| 1615 } |
| 1616 |
1612 void TraceLog::UpdateProcessLabel(int label_id, | 1617 void TraceLog::UpdateProcessLabel(int label_id, |
1613 const std::string& current_label) { | 1618 const std::string& current_label) { |
1614 if (!current_label.length()) | 1619 if (!current_label.length()) |
1615 return RemoveProcessLabel(label_id); | 1620 return RemoveProcessLabel(label_id); |
1616 | 1621 |
1617 AutoLock lock(lock_); | 1622 AutoLock lock(lock_); |
1618 process_labels_[label_id] = current_label; | 1623 process_labels_[label_id] = current_label; |
1619 } | 1624 } |
1620 | 1625 |
1621 void TraceLog::RemoveProcessLabel(int label_id) { | 1626 void TraceLog::RemoveProcessLabel(int label_id) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 } | 1730 } |
1726 | 1731 |
1727 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1732 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
1728 if (*category_group_enabled_) { | 1733 if (*category_group_enabled_) { |
1729 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1734 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
1730 event_handle_); | 1735 event_handle_); |
1731 } | 1736 } |
1732 } | 1737 } |
1733 | 1738 |
1734 } // namespace trace_event_internal | 1739 } // namespace trace_event_internal |
OLD | NEW |