Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tommy Webb
Tor Browser
Commits
27386c5a
Commit
27386c5a
authored
12 years ago
by
Ed Morley
Browse files
Options
Downloads
Patches
Plain Diff
Backout b5c19fdea86e (bug 809317) for windows build bustage
parent
ae1525c6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/profiler/TableTicker.cpp
+7
-53
7 additions, 53 deletions
tools/profiler/TableTicker.cpp
with
7 additions
and
53 deletions
tools/profiler/TableTicker.cpp
+
7
−
53
View file @
27386c5a
...
...
@@ -801,8 +801,12 @@ void StackWalkCallback(void* aPC, void* aSP, void* aClosure)
array
->
count
++
;
}
static
void
doMerge
Backtrace
(
ThreadProfile
&
aProfile
,
TickSample
*
aSample
,
void
*
aThread
)
void
TableTicker
::
do
Backtrace
(
ThreadProfile
&
aProfile
,
TickSample
*
aSample
)
{
#ifndef XP_MACOSX
uintptr_t
thread
=
GetThreadHandle
(
platform_data
());
MOZ_ASSERT
(
thread
);
#endif
void
*
pc_array
[
1000
];
void
*
sp_array
[
1000
];
PCArray
array
=
{
...
...
@@ -816,13 +820,7 @@ static void doMergeBacktrace(ThreadProfile &aProfile, TickSample* aSample, void*
StackWalkCallback
(
aSample
->
pc
,
aSample
->
sp
,
&
array
);
#ifdef XP_MACOSX
pthread_t
pt
;
if
(
aThread
)
{
pt
=
(
pthread_t
)
aThread
;
}
else
{
pt
=
pthread_self
();
}
pthread_t
pt
=
GetProfiledThread
(
platform_data
());
void
*
stackEnd
=
reinterpret_cast
<
void
*>
(
-
1
);
if
(
pt
)
stackEnd
=
static_cast
<
char
*>
(
pthread_get_stackaddr_np
(
pt
));
...
...
@@ -830,9 +828,6 @@ static void doMergeBacktrace(ThreadProfile &aProfile, TickSample* aSample, void*
if
(
aSample
->
fp
>=
aSample
->
sp
&&
aSample
->
fp
<=
stackEnd
)
rv
=
FramePointerStackWalk
(
StackWalkCallback
,
0
,
&
array
,
reinterpret_cast
<
void
**>
(
aSample
->
fp
),
stackEnd
);
#else
uintptr_t
thread
=
(
uintptr_t
)
aThread
;
GetThreadHandle
(
platform_data
());
MOZ_ASSERT
(
thread
);
nsresult
rv
=
NS_StackWalk
(
StackWalkCallback
,
0
,
&
array
,
thread
);
#endif
if
(
NS_SUCCEEDED
(
rv
))
{
...
...
@@ -874,16 +869,6 @@ static void doMergeBacktrace(ThreadProfile &aProfile, TickSample* aSample, void*
}
}
}
void
TableTicker
::
doBacktrace
(
ThreadProfile
&
aProfile
,
TickSample
*
aSample
)
{
#ifdef XP_MACOSX
doMergeBacktrace
(
aProfile
,
aSample
,
GetProfiledThread
(
platform_data
()));
#else
doMergeBacktrace
(
aProfile
,
aSample
,
GetThreadHandle
(
platform_data
()));
#endif
}
#endif
#if defined(USE_LIBUNWIND) && defined(ANDROID)
...
...
@@ -1280,17 +1265,6 @@ void print_callback(const ProfileEntry& entry, const char* tagStringData) {
case
's'
:
case
'c'
:
printf_stderr
(
" %s
\n
"
,
tagStringData
);
break
;
case
'l'
:
unsigned
long
long
pc
=
(
unsigned
long
long
)(
uintptr_t
)
entry
.
mTagPtr
;
nsCodeAddressDetails
details
;
NS_DescribeCodeAddress
((
void
*
)
pc
,
&
details
);
if
(
details
.
function
)
{
printf_stderr
(
" %s
\n
"
,
details
.
function
);
}
else
{
printf_stderr
(
" %#llx
\n
"
,
pc
);
}
break
;
}
}
...
...
@@ -1305,28 +1279,8 @@ void mozilla_sampler_print_location()
return
;
}
ThreadProfile
threadProfile
(
2000
,
stack
);
#ifdef USE_NS_STACKWALK
// Get the frame pointer
void
**
bp
;
#if defined(__i386)
__asm__
(
"movl %%ebp, %0"
:
"=g"
(
bp
));
#else
// It would be nice if this worked uniformly, but at least on i386 and
// x86_64, it stopped working with gcc 4.1, because it points to the
// end of the saved registers instead of the start.
bp
=
(
void
**
)
__builtin_frame_address
(
0
);
#endif
TickSample
sample
;
sample
.
fp
=
(
unsigned
char
*
)
bp
;
sample
.
pc
=
nullptr
;
sample
.
sp
=
(
unsigned
char
*
)
&
stack
;
doMergeBacktrace
(
threadProfile
,
&
sample
,
0
);
#else
ThreadProfile
threadProfile
(
1000
,
stack
);
doSampleStackTrace
(
stack
,
threadProfile
,
NULL
);
#endif
threadProfile
.
flush
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment