Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: chrome/browser/chrome_browser_field_trials_desktop.cc

Issue 2221343002: Revert "Track thread activities in order to diagnose hangs." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/threading/platform_thread_win.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chrome_browser_field_trials_desktop.h" 5 #include "chrome/browser/chrome_browser_field_trials_desktop.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/activity_tracker.h"
11 #include "base/feature_list.h"
12 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
13 #include "base/path_service.h"
14 #include "chrome/browser/prerender/prerender_field_trial.h" 11 #include "chrome/browser/prerender/prerender_field_trial.h"
15 #include "chrome/common/chrome_paths.h"
16 #include "chrome/common/chrome_switches.h" 12 #include "chrome/common/chrome_switches.h"
17 #include "chrome/common/variations/variations_util.h" 13 #include "chrome/common/variations/variations_util.h"
18 #include "components/variations/variations_associated_data.h" 14 #include "components/variations/variations_associated_data.h"
19 #include "content/public/common/content_switches.h" 15 #include "content/public/common/content_switches.h"
20 16
21 namespace chrome { 17 namespace chrome {
22 18
23 namespace { 19 namespace {
24 20
25 const base::Feature kStabilityDebuggingFeature{
26 "StabilityDebugging", base::FEATURE_DISABLED_BY_DEFAULT
27 };
28
29 void SetupLightSpeedTrials() { 21 void SetupLightSpeedTrials() {
30 if (!variations::GetVariationParamValue("LightSpeed", "NoGpu").empty()) { 22 if (!variations::GetVariationParamValue("LightSpeed", "NoGpu").empty()) {
31 base::CommandLine::ForCurrentProcess()->AppendSwitch( 23 base::CommandLine::ForCurrentProcess()->AppendSwitch(
32 switches::kDisableGpu); 24 switches::kDisableGpu);
33 } 25 }
34 } 26 }
35 27
36 void SetupStunProbeTrial() { 28 void SetupStunProbeTrial() {
37 #if defined(ENABLE_WEBRTC) 29 #if defined(ENABLE_WEBRTC)
38 std::map<std::string, std::string> params; 30 std::map<std::string, std::string> params;
39 if (!variations::GetVariationParams("StunProbeTrial2", &params)) 31 if (!variations::GetVariationParams("StunProbeTrial2", &params))
40 return; 32 return;
41 33
42 // The parameter, used by StartStunFieldTrial, should have the following 34 // The parameter, used by StartStunFieldTrial, should have the following
43 // format: "request_per_ip/interval/sharedsocket/batch_size/total_batches/ 35 // format: "request_per_ip/interval/sharedsocket/batch_size/total_batches/
44 // server1:port/server2:port/server3:port/" 36 // server1:port/server2:port/server3:port/"
45 std::string cmd_param = params["request_per_ip"] + "/" + params["interval"] + 37 std::string cmd_param = params["request_per_ip"] + "/" + params["interval"] +
46 "/" + params["sharedsocket"] + "/" + 38 "/" + params["sharedsocket"] + "/" +
47 params["batch_size"] + "/" + params["total_batches"] + 39 params["batch_size"] + "/" + params["total_batches"] +
48 "/" + params["server1"] + "/" + params["server2"] + 40 "/" + params["server1"] + "/" + params["server2"] +
49 "/" + params["server3"] + "/" + params["server4"] + 41 "/" + params["server3"] + "/" + params["server4"] +
50 "/" + params["server5"] + "/" + params["server6"]; 42 "/" + params["server5"] + "/" + params["server6"];
51 43
52 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 44 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
53 switches::kWebRtcStunProbeTrialParameter, cmd_param); 45 switches::kWebRtcStunProbeTrialParameter, cmd_param);
54 #endif 46 #endif
55 } 47 }
56 48
57 void SetupStabilityDebugging() {
58 if (!base::FeatureList::IsEnabled(kStabilityDebuggingFeature))
59 return;
60
61 // TODO(bcwhite): Adjust these numbers once there is real data to show
62 // just how much of an arena is necessary.
63 const size_t kMemorySize = 1 << 20; // 1 MiB
64 const int kStackDepth = 4;
65 const uint64_t kAllocatorId = 0;
66
67 // Track code activities (such as posting task, blocking on locks, and
68 // joining threads) that can cause hanging threads and general instability.
69 base::FilePath user_data_dir;
70 bool success = base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
71 DCHECK(success);
72 base::debug::GlobalActivityTracker::CreateWithFile(
73 user_data_dir
74 .AppendASCII("StabilityDebugInfo")
75 .AddExtension(base::PersistentMemoryAllocator::kFileExtension),
76 kMemorySize, kAllocatorId, kStabilityDebuggingFeature.name, kStackDepth);
77 }
78
79 } // namespace 49 } // namespace
80 50
81 void SetupDesktopFieldTrials(const base::CommandLine& parsed_command_line) { 51 void SetupDesktopFieldTrials(const base::CommandLine& parsed_command_line) {
82 prerender::ConfigurePrerender(parsed_command_line); 52 prerender::ConfigurePrerender(parsed_command_line);
83 SetupLightSpeedTrials(); 53 SetupLightSpeedTrials();
84 SetupStunProbeTrial(); 54 SetupStunProbeTrial();
85 SetupStabilityDebugging();
86 } 55 }
87 56
88 } // namespace chrome 57 } // namespace chrome
OLDNEW
« no previous file with comments | « base/threading/platform_thread_win.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698