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

Side by Side Diff: runtime/vm/profiler_service.cc

Issue 1410543011: Fix processing profiler samples in the presence of Thumb code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/profiler_service.h" 5 #include "vm/profiler_service.h"
6 6
7 #include "vm/growable_array.h" 7 #include "vm/growable_array.h"
8 #include "vm/native_symbol.h" 8 #include "vm/native_symbol.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/os.h" 10 #include "vm/os.h"
(...skipping 1887 matching lines...) Expand 10 before | Expand all | Expand 10 after
1898 char* native_name = NativeSymbolResolver::LookupSymbolName(pc, 1898 char* native_name = NativeSymbolResolver::LookupSymbolName(pc,
1899 &native_start); 1899 &native_start);
1900 if (native_name == NULL) { 1900 if (native_name == NULL) {
1901 // No native name found. 1901 // No native name found.
1902 return new ProfileCode(ProfileCode::kNativeCode, 1902 return new ProfileCode(ProfileCode::kNativeCode,
1903 pc, 1903 pc,
1904 pc + 1, 1904 pc + 1,
1905 0, 1905 0,
1906 code); 1906 code);
1907 } 1907 }
1908
1909 #if defined(HOST_ARCH_ARM)
1910 // The symbol for a Thumb function will be xxx1, but we may have samples
1911 // at function entry which will have pc xxx0.
1912 native_start &= ~1;
1913 #endif
1914
1908 ASSERT(pc >= native_start); 1915 ASSERT(pc >= native_start);
1909 ProfileCode* profile_code = 1916 ProfileCode* profile_code =
1910 new ProfileCode(ProfileCode::kNativeCode, 1917 new ProfileCode(ProfileCode::kNativeCode,
1911 native_start, 1918 native_start,
1912 pc + 1, 1919 pc + 1,
1913 0, 1920 0,
1914 code); 1921 code);
1915 profile_code->SetName(native_name); 1922 profile_code->SetName(native_name);
1916 free(native_name); 1923 NativeSymbolResolver::FreeSymbolName(native_name);
1917 return profile_code; 1924 return profile_code;
1918 } 1925 }
1919 1926
1920 ProfileCode* RegisterProfileCode(uword pc, int64_t timestamp) { 1927 ProfileCode* RegisterProfileCode(uword pc, int64_t timestamp) {
1921 ProfileCodeTable* live_table = profile_->live_code_; 1928 ProfileCodeTable* live_table = profile_->live_code_;
1922 ProfileCodeTable* dead_table = profile_->dead_code_; 1929 ProfileCodeTable* dead_table = profile_->dead_code_;
1923 1930
1924 ProfileCode* code = live_table->FindCodeForPC(pc); 1931 ProfileCode* code = live_table->FindCodeForPC(pc);
1925 if (code == NULL) { 1932 if (code == NULL) {
1926 // Code not found. 1933 // Code not found.
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
2302 ASSERT(sample_buffer != NULL); 2309 ASSERT(sample_buffer != NULL);
2303 2310
2304 ClearProfileVisitor clear_profile(isolate); 2311 ClearProfileVisitor clear_profile(isolate);
2305 sample_buffer->VisitSamples(&clear_profile); 2312 sample_buffer->VisitSamples(&clear_profile);
2306 2313
2307 // Enable profile interrupts. 2314 // Enable profile interrupts.
2308 Profiler::BeginExecution(isolate); 2315 Profiler::BeginExecution(isolate);
2309 } 2316 }
2310 2317
2311 } // namespace dart 2318 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698