Home | History | Annotate | Download | only in tracing
      1 // Copyright 2016 the V8 project authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include <string.h>
      6 
      7 #include "include/libplatform/v8-tracing.h"
      8 #include "src/base/logging.h"
      9 
     10 namespace v8 {
     11 
     12 class Isolate;
     13 
     14 namespace platform {
     15 namespace tracing {
     16 
     17 TraceConfig* TraceConfig::CreateDefaultTraceConfig() {
     18   TraceConfig* trace_config = new TraceConfig();
     19   trace_config->included_categories_.push_back("v8");
     20   return trace_config;
     21 }
     22 
     23 bool TraceConfig::IsCategoryGroupEnabled(const char* category_group) const {
     24   for (auto included_category : included_categories_) {
     25     if (strcmp(included_category.data(), category_group) == 0) return true;
     26   }
     27   return false;
     28 }
     29 
     30 void TraceConfig::AddIncludedCategory(const char* included_category) {
     31   DCHECK(included_category != NULL && strlen(included_category) > 0);
     32   included_categories_.push_back(included_category);
     33 }
     34 
     35 }  // namespace tracing
     36 }  // namespace platform
     37 }  // namespace v8
     38