Skip to content

Commit 967deb8

Browse files
mralephcommit-bot@chromium.org
authored andcommitted
Revert "[vm, timeline] Fix compilation failed below macOS 10.14"
This reverts commit 156ef76. Reason for revert: broke compilation on buildbots Original change's description: > [vm, timeline] Fix compilation failed below macOS 10.14 > > signpost.h exists in macOS 10.14 or above, so compilation failed below macOS 10.14 > > Change-Id: I97c4d6652f8330d3fc150186e41067c80c3b56f2 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151101 > Commit-Queue: Vyacheslav Egorov <[email protected]> > Reviewed-by: Vyacheslav Egorov <[email protected]> [email protected],[email protected] Change-Id: I04cd72a0c16a9e1d32d1735abf0fe42d35d240e1 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151380 Reviewed-by: Vyacheslav Egorov <[email protected]> Commit-Queue: Vyacheslav Egorov <[email protected]>
1 parent 156ef76 commit 967deb8

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

runtime/vm/timeline.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ static TimelineEventRecorder* CreateTimelineRecorder() {
117117
#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
118118
return new TimelineEventSystraceRecorder();
119119
#elif defined(HOST_OS_MACOS)
120-
return new TimelineEventMacosRecorder();
120+
if (__builtin_available(iOS 12.0, macOS 10.14, *)) {
121+
return new TimelineEventMacosRecorder();
122+
}
121123
#elif defined(HOST_OS_FUCHSIA)
122124
return new TimelineEventFuchsiaRecorder();
123125
#else
@@ -765,8 +767,10 @@ TimelineStream::TimelineStream(const char* name,
765767
enabled_(static_cast<uintptr_t>(enabled))
766768
#endif
767769
{
768-
#if defined(HOST_OS_SUPPORTS_SIGNPOST)
769-
macos_log_ = os_log_create("Dart", name);
770+
#if defined(HOST_OS_MACOS)
771+
if (__builtin_available(iOS 12.0, macOS 10.14, *)) {
772+
macos_log_ = os_log_create("Dart", name);
773+
}
770774
#endif
771775
}
772776

runtime/vm/timeline.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,8 @@
2020
#include <lib/trace-engine/instrumentation.h>
2121
#elif defined(HOST_OS_MACOS)
2222
#include <os/availability.h>
23-
#if defined(__MAC_10_14) || defined (__IPHONE_12_0)
24-
#define HOST_OS_SUPPORTS_SIGNPOST 1
25-
#endif
26-
//signpost.h exists in macOS 10.14, iOS 12 or above
27-
#if defined(HOST_OS_SUPPORTS_SIGNPOST)
2823
#include <os/signpost.h>
2924
#endif
30-
#endif
3125

3226
namespace dart {
3327

@@ -100,7 +94,7 @@ class TimelineStream {
10094

10195
#if defined(HOST_OS_FUCHSIA)
10296
trace_site_t* trace_site() { return &trace_site_; }
103-
#elif defined(HOST_OS_SUPPORTS_SIGNPOST)
97+
#elif defined(HOST_OS_MACOS)
10498
os_log_t macos_log() { return macos_log_; }
10599
#endif
106100

@@ -114,7 +108,7 @@ class TimelineStream {
114108

115109
#if defined(HOST_OS_FUCHSIA)
116110
trace_site_t trace_site_ = {};
117-
#elif defined(HOST_OS_SUPPORTS_SIGNPOST)
111+
#elif defined(HOST_OS_MACOS)
118112
os_log_t macos_log_ = {};
119113
#endif
120114
};

runtime/vm/timeline_macos.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
#include "vm/globals.h"
66
#if defined(HOST_OS_MACOS) && defined(SUPPORT_TIMELINE)
77

8+
#include <os/signpost.h>
89

910
#include "vm/log.h"
1011
#include "vm/timeline.h"
1112

12-
#if defined(HOST_OS_SUPPORTS_SIGNPOST)
13-
#include <os/signpost.h>
14-
#endif
15-
1613
namespace dart {
1714

1815
// Only available on iOS 12.0, macOS 10.14 or above
@@ -26,7 +23,6 @@ void TimelineEventMacosRecorder::OnEvent(TimelineEvent* event) {
2623
return;
2724
}
2825

29-
#if defined(HOST_OS_SUPPORTS_SIGNPOST)
3026
os_log_t log = event->stream_->macos_log();
3127
if (!os_signpost_enabled(log)) {
3228
return;
@@ -79,7 +75,6 @@ void TimelineEventMacosRecorder::OnEvent(TimelineEvent* event) {
7975
default:
8076
break;
8177
}
82-
#endif // defined(HOST_OS_SUPPORTS_SIGNPOST)
8378
}
8479

8580
} // namespace dart

0 commit comments

Comments
 (0)