Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidSystemCore
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
AndroidSystemCore
Commits
f1833245
Commit
f1833245
authored
Sep 4, 2015
by
Mark Salyzyn
Committed by
Android (Google) Code Review
Sep 4, 2015
Browse files
Options
Downloads
Plain Diff
Merge "logd: worst uid record watermark part four" into mnc-dr-dev
parents
5e294902
4ee37bc9
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
logd/LogBuffer.cpp
+9
-8
9 additions, 8 deletions
logd/LogBuffer.cpp
logd/LogBuffer.h
+2
-1
2 additions, 1 deletion
logd/LogBuffer.h
with
11 additions
and
9 deletions
logd/LogBuffer.cpp
+
9
−
8
View file @
f1833245
...
...
@@ -238,7 +238,8 @@ void LogBuffer::maybePrune(log_id_t id) {
}
}
LogBufferElementCollection
::
iterator
LogBuffer
::
erase
(
LogBufferElementCollection
::
iterator
it
)
{
LogBufferElementCollection
::
iterator
LogBuffer
::
erase
(
LogBufferElementCollection
::
iterator
it
,
bool
engageStats
)
{
LogBufferElement
*
e
=
*
it
;
log_id_t
id
=
e
->
getLogId
();
LogBufferIteratorMap
::
iterator
f
=
mLastWorstUid
[
id
].
find
(
e
->
getUid
());
...
...
@@ -247,7 +248,11 @@ LogBufferElementCollection::iterator LogBuffer::erase(LogBufferElementCollection
mLastWorstUid
[
id
].
erase
(
f
);
}
it
=
mLogElements
.
erase
(
it
);
if
(
engageStats
)
{
stats
.
subtract
(
e
);
}
else
{
stats
.
erase
(
e
);
}
delete
e
;
return
it
;
...
...
@@ -442,9 +447,7 @@ void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
// merge any drops
if
(
dropped
&&
last
.
merge
(
e
,
dropped
))
{
it
=
mLogElements
.
erase
(
it
);
stats
.
erase
(
e
);
delete
e
;
it
=
erase
(
it
,
false
);
continue
;
}
...
...
@@ -510,9 +513,7 @@ void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
stats
.
drop
(
e
);
e
->
setDropped
(
1
);
if
(
last
.
merge
(
e
,
1
))
{
it
=
mLogElements
.
erase
(
it
);
stats
.
erase
(
e
);
delete
e
;
it
=
erase
(
it
,
false
);
}
else
{
last
.
add
(
e
);
mLastWorstUid
[
id
][
e
->
getUid
()]
=
it
;
...
...
This diff is collapsed.
Click to expand it.
logd/LogBuffer.h
+
2
−
1
View file @
f1833245
...
...
@@ -87,7 +87,8 @@ public:
private
:
void
maybePrune
(
log_id_t
id
);
void
prune
(
log_id_t
id
,
unsigned
long
pruneRows
,
uid_t
uid
=
AID_ROOT
);
LogBufferElementCollection
::
iterator
erase
(
LogBufferElementCollection
::
iterator
it
);
LogBufferElementCollection
::
iterator
erase
(
LogBufferElementCollection
::
iterator
it
,
bool
engageStats
=
true
);
};
#endif // _LOGD_LOG_BUFFER_H__
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