Commit 35f5b3dc authored by bmeurer's avatar bmeurer Committed by Commit bot

Revert of Add a trace-event for each runtime-stats timer (patchset #6...

Revert of Add a trace-event for each runtime-stats timer (patchset #6 id:100001 of https://codereview.chromium.org/2052523002/ )

Reason for revert:
Seems to break TSAN, see http://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/10057

Original issue's description:
> The trace-events will have a high overhead when turned on, but they are in a disabled-by-default category.
>
> As long as the off overhead is negligible, this CL allows us to understand the behavior of V8 rather than its performance at the moment.
>
> BUG=v8:5089
>
> Committed: https://crrev.com/44ec143f26769bd103662643bfeafc7d0834cc90
> Cr-Commit-Position: refs/heads/master@{#36909}

TBR=cbruni@chromium.org,fmeawad@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5089

Review-Url: https://codereview.chromium.org/2064553002
Cr-Commit-Position: refs/heads/master@{#36910}
parent 44ec143f
......@@ -20,7 +20,6 @@ namespace internal {
Handle<Name> name) { \
Isolate* isolate = this->isolate(); \
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \
TRACE_RUNTIME_CALL(#Function); \
VMState<EXTERNAL> state(isolate); \
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
PropertyCallbackInfo<ApiReturn> info(begin()); \
......@@ -45,7 +44,6 @@ FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(WRITE_CALL_1_NAME)
uint32_t index) { \
Isolate* isolate = this->isolate(); \
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \
TRACE_RUNTIME_CALL(#Function); \
VMState<EXTERNAL> state(isolate); \
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
PropertyCallbackInfo<ApiReturn> info(begin()); \
......@@ -66,7 +64,6 @@ Handle<Object> PropertyCallbackArguments::Call(
Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(
isolate, &RuntimeCallStats::GenericNamedPropertySetterCallback);
TRACE_RUNTIME_CALL("GenericNamedPropertySetterCallback");
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<v8::Value> info(begin());
......@@ -82,7 +79,6 @@ Handle<Object> PropertyCallbackArguments::Call(IndexedPropertySetterCallback f,
Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(isolate,
&RuntimeCallStats::IndexedPropertySetterCallback);
TRACE_RUNTIME_CALL("IndexedPropertySetterCallback");
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<v8::Value> info(begin());
......@@ -97,7 +93,6 @@ void PropertyCallbackArguments::Call(AccessorNameSetterCallback f,
Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(isolate,
&RuntimeCallStats::AccessorNameSetterCallback);
TRACE_RUNTIME_CALL("AccessorNameSetterCallback");
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<void> info(begin());
......
......@@ -13,7 +13,6 @@ namespace internal {
Handle<Object> FunctionCallbackArguments::Call(FunctionCallback f) {
Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::FunctionCallback);
TRACE_RUNTIME_CALL("FunctionCallback");
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
FunctionCallbackInfo<v8::Value> info(begin(), argv_, argc_);
......@@ -25,7 +24,6 @@ Handle<JSObject> PropertyCallbackArguments::Call(
IndexedPropertyEnumeratorCallback f) {
Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::PropertyCallback);
TRACE_RUNTIME_CALL("PropertyCallback");
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<v8::Array> info(begin());
......
......@@ -73,7 +73,6 @@ namespace v8 {
#define LOG_API(isolate, class_name, function_name) \
i::RuntimeCallTimerScope _runtime_timer( \
isolate, &i::RuntimeCallStats::API_##class_name##_##function_name); \
TRACE_RUNTIME_CALL(#class_name "::" #function_name); \
LOG(isolate, ApiEntryCall("v8::" #class_name "::" #function_name))
#define ENTER_V8(isolate) i::VMState<v8::OTHER> __state__((isolate))
......@@ -1765,7 +1764,6 @@ MaybeLocal<Value> Script::Run(Local<Context> context) {
i::AggregatingHistogramTimerScope timer(isolate->counters()->compile_lazy());
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
auto fun = i::Handle<i::JSFunction>::cast(Utils::OpenHandle(this));
i::Handle<i::Object> receiver = isolate->global_proxy();
Local<Value> result;
......@@ -1820,7 +1818,6 @@ MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal(
{
i::HistogramTimerScope total(isolate->counters()->compile_script(), true);
TRACE_EVENT0("v8", "V8.CompileScript");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
i::Handle<i::Object> name_obj;
i::Handle<i::Object> source_map_url;
int line_offset = 0;
......@@ -4345,7 +4342,6 @@ MaybeLocal<Value> Object::CallAsFunction(Local<Context> context,
i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true);
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
auto self = Utils::OpenHandle(this);
auto recv_obj = Utils::OpenHandle(*recv);
STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
......@@ -4374,7 +4370,6 @@ MaybeLocal<Value> Object::CallAsConstructor(Local<Context> context, int argc,
i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true);
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
auto self = Utils::OpenHandle(this);
STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
......@@ -4425,7 +4420,6 @@ MaybeLocal<Object> Function::NewInstance(Local<Context> context, int argc,
i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true);
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
auto self = Utils::OpenHandle(this);
STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
......@@ -4451,7 +4445,6 @@ MaybeLocal<v8::Value> Function::Call(Local<Context> context,
i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true);
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
auto self = Utils::OpenHandle(this);
i::Handle<i::Object> recv_obj = Utils::OpenHandle(*recv);
STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
......@@ -5596,8 +5589,6 @@ Local<Context> v8::Context::New(v8::Isolate* external_isolate,
v8::Local<Value> global_object) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate);
LOG_API(isolate, Context, New);
TRACE_EVENT0("v8", "V8.NewContext");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
i::HandleScope scope(isolate);
ExtensionConfiguration no_extensions;
if (extensions == NULL) extensions = &no_extensions;
......@@ -8787,7 +8778,6 @@ void InvokeAccessorGetterCallback(
Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
RuntimeCallTimerScope timer(isolate,
&RuntimeCallStats::AccessorGetterCallback);
TRACE_RUNTIME_CALL("AccessorGetterCallback");
Address getter_address = reinterpret_cast<Address>(reinterpret_cast<intptr_t>(
getter));
VMState<EXTERNAL> state(isolate);
......@@ -8801,7 +8791,6 @@ void InvokeFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info,
Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
RuntimeCallTimerScope timer(isolate,
&RuntimeCallStats::InvokeFunctionCallback);
TRACE_RUNTIME_CALL("InvokeFunctionCallback");
Address callback_address =
reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
VMState<EXTERNAL> state(isolate);
......
......@@ -13,7 +13,6 @@
#include "src/globals.h"
#include "src/objects.h"
#include "src/runtime/runtime.h"
#include "src/tracing/trace-event.h"
namespace v8 {
namespace internal {
......@@ -787,7 +786,6 @@ class RuntimeCallStats {
#define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \
do { \
TRACE_RUNTIME_CALL(#counter_name); \
if (FLAG_runtime_call_stats) { \
RuntimeCallStats::CorrectCurrentCounterId( \
isolate, &RuntimeCallStats::counter_name); \
......
......@@ -95,7 +95,6 @@ MUST_USE_RESULT MaybeHandle<Object> Invoke(Isolate* isolate, bool is_construct,
PrintDeserializedCodeInfo(Handle<JSFunction>::cast(target));
}
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::JS_Execution);
TRACE_RUNTIME_CALL("JS_Execution");
value = CALL_GENERATED_CODE(isolate, stub_entry, orig_func, func, recv,
argc, argv);
}
......
......@@ -352,8 +352,6 @@ void LookupIterator::Delete() {
isolate_, is_prototype_map
? &RuntimeCallStats::PrototypeObject_DeleteProperty
: &RuntimeCallStats::Object_DeleteProperty);
TRACE_RUNTIME_CALL(is_prototype_map ? "PrototypeObject_DeleteProperty"
: "Object_DeleteProperty");
PropertyNormalizationMode mode =
is_prototype_map ? KEEP_INOBJECT_PROPERTIES : CLEAR_INOBJECT_PROPERTIES;
......
......@@ -9161,9 +9161,6 @@ Handle<Map> Map::TransitionToDataProperty(Handle<Map> map, Handle<Name> name,
*map, map->is_prototype_map()
? &RuntimeCallStats::PrototypeMap_TransitionToDataProperty
: &RuntimeCallStats::Map_TransitionToDataProperty);
TRACE_RUNTIME_CALL(map->is_prototype_map()
? "PrototypeMap_TransitionToDataProperty"
: "Map_TransitionToDataProperty");
DCHECK(name->IsUniqueName());
DCHECK(!map->is_dictionary_map());
......@@ -9250,9 +9247,6 @@ Handle<Map> Map::TransitionToAccessorProperty(Isolate* isolate, Handle<Map> map,
map->is_prototype_map()
? &RuntimeCallStats::PrototypeMap_TransitionToAccessorProperty
: &RuntimeCallStats::Map_TransitionToAccessorProperty);
TRACE_RUNTIME_CALL(map->is_prototype_map()
? "PrototypeMap_TransitionToAccessorProperty"
: "Map_TransitionToAccessorProperty");
// At least one of the accessors needs to be a new value.
DCHECK(!getter->IsNull() || !setter->IsNull());
......@@ -12116,7 +12110,6 @@ Handle<Cell> Map::GetOrCreatePrototypeChainValidityCell(Handle<Map> map,
void Map::SetPrototype(Handle<Map> map, Handle<Object> prototype,
PrototypeOptimizationMode proto_mode) {
RuntimeCallTimerScope stats_scope(*map, &RuntimeCallStats::Map_SetPrototype);
TRACE_RUNTIME_CALL("Map_SetPrototype");
bool is_hidden = false;
if (prototype->IsJSObject()) {
......
......@@ -10,10 +10,6 @@ namespace v8 {
namespace internal {
namespace tracing {
// A global flag used as a shortcut to check for the
// v8.runtime category due to its high frequency use.
int kRuntimeCallsTracingEnabled = 0;
v8::Platform* TraceEventHelper::GetCurrentPlatform() {
return v8::internal::V8::GetCurrentPlatform();
}
......
......@@ -292,8 +292,6 @@ const int kZeroNumArgs = 0;
const decltype(nullptr) kGlobalScope = nullptr;
const uint64_t kNoId = 0;
extern int kRuntimeCallsTracingEnabled;
class TraceEventHelper {
public:
static v8::Platform* GetCurrentPlatform();
......@@ -596,25 +594,4 @@ class TraceEventSamplingStateScope {
} // namespace internal
} // namespace v8
// V8 Specific macros
#define TRACE_IS_RUNTIME_CALLS_TRACING_ENABLED() \
v8::internal::tracing::kRuntimeCallsTracingEnabled == 1
#define TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING() \
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO( \
TRACE_DISABLED_BY_DEFAULT("v8.runtime")); \
v8::internal::tracing::kRuntimeCallsTracingEnabled = \
INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE() ? 1 \
: 0; \
} while (0)
#define TRACE_RUNTIME_CALL(name) \
do { \
if (V8_UNLIKELY(TRACE_IS_RUNTIME_CALLS_TRACING_ENABLED())) { \
INTERNAL_TRACE_EVENT_ADD_SCOPED(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), \
name); \
} \
} while (0)
#endif // SRC_TRACING_TRACE_EVENT_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment