Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_packages_modules_Bluetooth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
LMODroid
platform_packages_modules_Bluetooth
Commits
a06b623b
Commit
a06b623b
authored
9 years ago
by
Andre Eisenbach
Browse files
Options
Downloads
Patches
Plain Diff
Log error code on wakelock acquisition/release failure
Bug: 27721443 Change-Id: I8ac9e738d916bfdcf125e33c0e09f90cc8d26d55
parent
7a49ab5e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
system/osi/src/wakelock.c
+17
-9
17 additions, 9 deletions
system/osi/src/wakelock.c
with
17 additions
and
9 deletions
system/osi/src/wakelock.c
+
17
−
9
View file @
a06b623b
...
...
@@ -66,6 +66,8 @@ typedef struct {
period_ms_t
last_acquired_timestamp_ms
;
period_ms_t
last_released_timestamp_ms
;
period_ms_t
last_reset_timestamp_ms
;
int
last_acquired_error
;
int
last_released_error
;
}
wakelock_stats_t
;
static
wakelock_stats_t
wakelock_stats
;
...
...
@@ -275,8 +277,10 @@ static void update_wakelock_acquired_stats(bt_status_t acquired_status) {
pthread_mutex_lock
(
&
monitor
);
if
(
acquired_status
!=
BT_STATUS_SUCCESS
)
if
(
acquired_status
!=
BT_STATUS_SUCCESS
)
{
wakelock_stats
.
acquired_errors
++
;
wakelock_stats
.
last_acquired_error
=
acquired_status
;
}
if
(
wakelock_stats
.
is_acquired
)
{
pthread_mutex_unlock
(
&
monitor
);
...
...
@@ -305,8 +309,10 @@ static void update_wakelock_released_stats(bt_status_t released_status) {
pthread_mutex_lock
(
&
monitor
);
if
(
released_status
!=
BT_STATUS_SUCCESS
)
if
(
released_status
!=
BT_STATUS_SUCCESS
)
{
wakelock_stats
.
released_errors
++
;
wakelock_stats
.
last_released_error
=
released_status
;
}
if
(
!
wakelock_stats
.
is_acquired
)
{
pthread_mutex_unlock
(
&
monitor
);
...
...
@@ -363,20 +369,22 @@ void wakelock_debug_dump(int fd) {
ave_interval
=
total_interval
/
wakelock_stats
.
acquired_count
;
dprintf
(
fd
,
"
\n
Bluetooth Wakelock Statistics:
\n
"
);
dprintf
(
fd
,
"
Wakelock i
s acquired : %s
\n
"
,
dprintf
(
fd
,
"
I
s acquired : %s
\n
"
,
wakelock_stats
.
is_acquired
?
"true"
:
"false"
);
dprintf
(
fd
,
"
Wakelock a
cquired/released count : %zu / %zu
\n
"
,
dprintf
(
fd
,
"
A
cquired/released count : %zu / %zu
\n
"
,
wakelock_stats
.
acquired_count
,
wakelock_stats
.
released_count
);
dprintf
(
fd
,
"
Wakelock a
cquired/released error
s
: %zu / %zu
\n
"
,
dprintf
(
fd
,
"
A
cquired/released error
count
: %zu / %zu
\n
"
,
wakelock_stats
.
acquired_errors
,
wakelock_stats
.
released_errors
);
dprintf
(
fd
,
" Wakelock last acquired time (ms) : %llu
\n
"
,
dprintf
(
fd
,
" Last acquire/release error code: %d / %d
\n
"
,
wakelock_stats
.
last_acquired_error
,
wakelock_stats
.
last_released_error
);
dprintf
(
fd
,
" Last acquired time (ms) : %llu
\n
"
,
(
unsigned
long
long
)
last_interval
);
dprintf
(
fd
,
"
Wakelock a
cquired time min/max/avg (ms) : %llu / %llu / %llu
\n
"
,
dprintf
(
fd
,
"
A
cquired time min/max/avg (ms) : %llu / %llu / %llu
\n
"
,
(
unsigned
long
long
)
min_interval
,
(
unsigned
long
long
)
max_interval
,
(
unsigned
long
long
)
ave_interval
);
dprintf
(
fd
,
"
Wakelock t
otal acquired time (ms) : %llu
\n
"
,
dprintf
(
fd
,
"
T
otal acquired time (ms) : %llu
\n
"
,
(
unsigned
long
long
)
total_interval
);
dprintf
(
fd
,
"
Bluetooth t
otal run time (ms) : %llu
\n
"
,
dprintf
(
fd
,
"
T
otal run time (ms)
: %llu
\n
"
,
(
unsigned
long
long
)(
now_ms
-
wakelock_stats
.
last_reset_timestamp_ms
));
if
(
lock_error
==
0
)
...
...
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