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
9aeb48bb
Commit
9aeb48bb
authored
2 years ago
by
Chris Manton
Committed by
Gerrit Code Review
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Add ability to lock stack for dumpsys"
parents
707000d1
24cc6949
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
system/main/shim/dumpsys.cc
+13
-10
13 additions, 10 deletions
system/main/shim/dumpsys.cc
system/main/shim/stack.cc
+5
-0
5 additions, 0 deletions
system/main/shim/stack.cc
system/main/shim/stack.h
+6
-4
6 additions, 4 deletions
system/main/shim/stack.h
with
24 additions
and
14 deletions
system/main/shim/dumpsys.cc
+
13
−
10
View file @
9aeb48bb
...
@@ -16,12 +16,13 @@
...
@@ -16,12 +16,13 @@
#define LOG_TAG "bt_shim_storage"
#define LOG_TAG "bt_shim_storage"
#include
"main/shim/dumpsys.h"
#include
<unordered_map>
#include
<unordered_map>
#include
"main/shim/dumpsys.h"
#include
"main/shim/entry.h"
#include
"main/shim/entry.h"
#include
"main/shim/shim.h"
#include
"main/shim/shim.h"
#include
"main/shim/stack.h"
#include
"shim/dumpsys.h"
#include
"shim/dumpsys.h"
namespace
{
namespace
{
...
@@ -53,14 +54,16 @@ void bluetooth::shim::Dump(int fd, const char** args) {
...
@@ -53,14 +54,16 @@ void bluetooth::shim::Dump(int fd, const char** args) {
dumpsys
.
second
(
fd
);
dumpsys
.
second
(
fd
);
}
}
}
}
if
(
bluetooth
::
shim
::
is_gd_stack_started_up
())
{
bluetooth
::
shim
::
Stack
::
GetInstance
()
->
LockForDumpsys
([
=
]()
{
if
(
bluetooth
::
shim
::
is_gd_dumpsys_module_started
())
{
if
(
bluetooth
::
shim
::
is_gd_stack_started_up
())
{
bluetooth
::
shim
::
GetDumpsys
()
->
Dump
(
fd
,
args
);
if
(
bluetooth
::
shim
::
is_gd_dumpsys_module_started
())
{
bluetooth
::
shim
::
GetDumpsys
()
->
Dump
(
fd
,
args
);
}
else
{
dprintf
(
fd
,
"%s NOTE: gd dumpsys module not loaded or started
\n
"
,
kModuleName
);
}
}
else
{
}
else
{
dprintf
(
fd
,
"%s NOTE: gd dumpsys module not loaded or started
\n
"
,
dprintf
(
fd
,
"%s gd stack is enabled but not started
\n
"
,
kModuleName
);
kModuleName
);
}
}
}
else
{
});
dprintf
(
fd
,
"%s gd stack is enabled but not started
\n
"
,
kModuleName
);
}
}
}
This diff is collapsed.
Click to expand it.
system/main/shim/stack.cc
+
5
−
0
View file @
9aeb48bb
...
@@ -317,5 +317,10 @@ bool Stack::IsDumpsysModuleStarted() const {
...
@@ -317,5 +317,10 @@ bool Stack::IsDumpsysModuleStarted() const {
return
GetStackManager
()
->
IsStarted
<
Dumpsys
>
();
return
GetStackManager
()
->
IsStarted
<
Dumpsys
>
();
}
}
void
Stack
::
LockForDumpsys
(
std
::
function
<
void
()
>
dumpsys_callback
)
{
std
::
lock_guard
<
std
::
recursive_mutex
>
lock
(
mutex_
);
dumpsys_callback
();
}
}
// namespace shim
}
// namespace shim
}
// namespace bluetooth
}
// namespace bluetooth
This diff is collapsed.
Click to expand it.
system/main/shim/stack.h
+
6
−
4
View file @
9aeb48bb
...
@@ -16,17 +16,17 @@
...
@@ -16,17 +16,17 @@
#pragma once
#pragma once
#include
<functional>
#include
<mutex>
#include
<mutex>
#include
"main/shim/acl.h"
#include
"main/shim/btm.h"
#include
"main/shim/link_policy_interface.h"
#include
"gd/module.h"
#include
"gd/module.h"
#include
"gd/os/handler.h"
#include
"gd/os/handler.h"
#include
"gd/os/thread.h"
#include
"gd/os/thread.h"
#include
"gd/os/utils.h"
#include
"gd/os/utils.h"
#include
"gd/stack_manager.h"
#include
"gd/stack_manager.h"
#include
"main/shim/acl.h"
#include
"main/shim/btm.h"
#include
"main/shim/link_policy_interface.h"
#include
"src/bridge.rs.h"
#include
"src/bridge.rs.h"
// The shim layer implementation on the Gd stack side.
// The shim layer implementation on the Gd stack side.
...
@@ -67,6 +67,8 @@ class Stack {
...
@@ -67,6 +67,8 @@ class Stack {
return
rust_controller_
;
return
rust_controller_
;
}
}
void
LockForDumpsys
(
std
::
function
<
void
()
>
dumpsys_callback
);
private
:
private
:
mutable
std
::
recursive_mutex
mutex_
;
mutable
std
::
recursive_mutex
mutex_
;
StackManager
stack_manager_
;
StackManager
stack_manager_
;
...
...
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