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

Issue 2855953002: leveldb: Add DBTracker for exposing databases to Chrome's memory-infra. (Closed)

Created:
3 years, 7 months ago by DmitrySkiba
Modified:
3 years, 4 months ago
CC:
awdf+watch_chromium.org, blink-worker-reviews_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, cmumford, darin-cc_chromium.org, extensions-reviews_chromium.org, fukino+watch_chromium.org, horo+watch_chromium.org, jam, johnme+watch_chromium.org, jsbell+idb_chromium.org, jsbell+serviceworker_chromium.org, kinuko+serviceworker, kinuko+watch, kinuko+fileapi, michaeln, mlamouri+watch-notifications_chromium.org, nhiroki, oka+watch_chromium.org, Peter Beverloo, serviceworker-reviews, shimazu+serviceworker_chromium.org, sync-reviews_chromium.org, tbansal+watch-data-reduction-proxy_chromium.org, tzik, yamaguchi+watch_chromium.org, zea+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

leveldb: Add DBTracker for exposing databases to Chrome's memory-infra. This CL adds DBTracker class that keeps track of all opened databases and reports them to memory-infra (part of Chrome tracing). For database to be tracked and reported it needs to be opened with leveldb_env::OpenDB() function, which is a drop-in replacement for leveldb::DB::Open(). Next CL will change all leveldb::DB::Open() invocations and add a presubmit check to prevent adding new ones. BUG=711518 Review-Url: https://codereview.chromium.org/2855953002 Cr-Commit-Position: refs/heads/master@{#483507} Committed: https://chromium.googlesource.com/chromium/src/+/542a7c89b3e856ef642d3ff6352e661717172395

Patch Set 1 #

Total comments: 1

Patch Set 2 : Finalize #

Patch Set 3 : Remove iterator wrapper #

Patch Set 4 : Add unittests #

Total comments: 9

Patch Set 5 : Address comments #

Total comments: 38

Patch Set 6 : Address comments #

Total comments: 9

Patch Set 7 : Don't include inttypes directly #

Patch Set 8 : OpenDB and friends #

Total comments: 2

Patch Set 9 : Fix Windows #

Patch Set 10 : Address comments #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+382 lines, -0 lines) Patch
M third_party/leveldatabase/env_chromium.h View 1 2 3 4 5 6 7 8 9 2 chunks +60 lines, -0 lines 1 comment Download
M third_party/leveldatabase/env_chromium.cc View 1 2 3 4 5 6 7 2 chunks +187 lines, -0 lines 0 comments Download
M third_party/leveldatabase/env_chromium_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +135 lines, -0 lines 0 comments Download

Messages

Total messages: 35 (18 generated)
ssid
https://codereview.chromium.org/2855953002/diff/1/third_party/leveldatabase/env_chromium.cc File third_party/leveldatabase/env_chromium.cc (right): https://codereview.chromium.org/2855953002/diff/1/third_party/leveldatabase/env_chromium.cc#newcode1147 third_party/leveldatabase/env_chromium.cc:1147: bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, If we are adding all ...
3 years, 7 months ago (2017-05-10 23:52:52 UTC) #2
DmitrySkiba
PTAL. The follow-up CL that changes DB::Open calls in Chrome is here: https://codereview.chromium.org/2953473002/
3 years, 6 months ago (2017-06-20 23:25:30 UTC) #5
Marijn Kruisselbrink
some drive-by comments https://codereview.chromium.org/2855953002/diff/60001/third_party/leveldatabase/env_chromium.cc File third_party/leveldatabase/env_chromium.cc (right): https://codereview.chromium.org/2855953002/diff/60001/third_party/leveldatabase/env_chromium.cc#newcode1181 third_party/leveldatabase/env_chromium.cc:1181: "leveldatabase/0x%" PRIXPTR, reinterpret_cast<uintptr_t>(db)); nit: should this ...
3 years, 6 months ago (2017-06-20 23:38:52 UTC) #7
ssid
memory-infra bits looks good. https://codereview.chromium.org/2855953002/diff/60001/third_party/leveldatabase/env_chromium.cc File third_party/leveldatabase/env_chromium.cc (right): https://codereview.chromium.org/2855953002/diff/60001/third_party/leveldatabase/env_chromium.cc#newcode1181 third_party/leveldatabase/env_chromium.cc:1181: "leveldatabase/0x%" PRIXPTR, reinterpret_cast<uintptr_t>(db)); On 2017/06/20 ...
3 years, 6 months ago (2017-06-20 23:52:13 UTC) #8
Marijn Kruisselbrink
https://codereview.chromium.org/2855953002/diff/60001/third_party/leveldatabase/env_chromium.h File third_party/leveldatabase/env_chromium.h (right): https://codereview.chromium.org/2855953002/diff/60001/third_party/leveldatabase/env_chromium.h#newcode244 third_party/leveldatabase/env_chromium.h:244: static leveldb::Status Open(const leveldb::Options& options, On 2017/06/20 at 23:52:13, ...
3 years, 6 months ago (2017-06-20 23:58:21 UTC) #9
DmitrySkiba
https://codereview.chromium.org/2855953002/diff/60001/third_party/leveldatabase/env_chromium.cc File third_party/leveldatabase/env_chromium.cc (right): https://codereview.chromium.org/2855953002/diff/60001/third_party/leveldatabase/env_chromium.cc#newcode1181 third_party/leveldatabase/env_chromium.cc:1181: "leveldatabase/0x%" PRIXPTR, reinterpret_cast<uintptr_t>(db)); On 2017/06/20 23:38:52, Marijn Kruisselbrink wrote: ...
3 years, 6 months ago (2017-06-20 23:59:21 UTC) #10
DmitrySkiba
https://codereview.chromium.org/2855953002/diff/60001/third_party/leveldatabase/env_chromium.cc File third_party/leveldatabase/env_chromium.cc (right): https://codereview.chromium.org/2855953002/diff/60001/third_party/leveldatabase/env_chromium.cc#newcode1220 third_party/leveldatabase/env_chromium.cc:1220: base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( On 2017/06/20 23:52:13, ssid wrote: > You cannot ...
3 years, 6 months ago (2017-06-21 01:08:06 UTC) #11
pwnall
Thank you for working on this! https://codereview.chromium.org/2855953002/diff/80001/third_party/leveldatabase/env_chromium.cc File third_party/leveldatabase/env_chromium.cc (right): https://codereview.chromium.org/2855953002/diff/80001/third_party/leveldatabase/env_chromium.cc#newcode1110 third_party/leveldatabase/env_chromium.cc:1110: DBWrapperImpl(const std::string name, ...
3 years, 6 months ago (2017-06-22 02:50:22 UTC) #12
pwnall
Also: this CL's purpose appears to be exposing LevelDB memory usage to the memory infrastructure. ...
3 years, 6 months ago (2017-06-22 02:54:41 UTC) #13
DmitrySkiba
https://codereview.chromium.org/2855953002/diff/80001/third_party/leveldatabase/env_chromium.cc File third_party/leveldatabase/env_chromium.cc (right): https://codereview.chromium.org/2855953002/diff/80001/third_party/leveldatabase/env_chromium.cc#newcode1110 third_party/leveldatabase/env_chromium.cc:1110: DBWrapperImpl(const std::string name, leveldb::DB* db) On 2017/06/22 02:50:22, pwnall ...
3 years, 5 months ago (2017-06-26 20:45:19 UTC) #14
DmitrySkiba
On 2017/06/22 02:54:41, pwnall wrote: > Also: this CL's purpose appears to be exposing LevelDB ...
3 years, 5 months ago (2017-06-26 20:47:57 UTC) #15
pwnall
Thank you for the revisions! I think this CL is getting quite close. In the ...
3 years, 5 months ago (2017-06-26 23:37:14 UTC) #21
DmitrySkiba
The latest patchset introduces leveldb_env::OpenDB() (as per comments). It turned out to be a very ...
3 years, 5 months ago (2017-06-28 20:35:29 UTC) #24
pwnall
LGTM w/ nits. https://codereview.chromium.org/2855953002/diff/100001/third_party/leveldatabase/env_chromium_unittest.cc File third_party/leveldatabase/env_chromium_unittest.cc (right): https://codereview.chromium.org/2855953002/diff/100001/third_party/leveldatabase/env_chromium_unittest.cc#newcode271 third_party/leveldatabase/env_chromium_unittest.cc:271: auto visit_databases = []() -> VisitedDBs ...
3 years, 5 months ago (2017-06-28 22:52:55 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2855953002/180001
3 years, 5 months ago (2017-06-29 20:42:42 UTC) #31
commit-bot: I haz the power
Committed patchset #10 (id:180001) as https://chromium.googlesource.com/chromium/src/+/542a7c89b3e856ef642d3ff6352e661717172395
3 years, 5 months ago (2017-06-29 21:58:37 UTC) #34
pwnall
3 years, 5 months ago (2017-06-30 22:21:09 UTC) #35
Message was sent while issue was closed.
Sorry, I just realized this today.

https://codereview.chromium.org/2855953002/diff/180001/third_party/leveldatab...
File third_party/leveldatabase/env_chromium.h (right):

https://codereview.chromium.org/2855953002/diff/180001/third_party/leveldatab...
third_party/leveldatabase/env_chromium.h:259: using DatabaseVisitor =
std::function<void(TrackedDB*)>;
Gah, I just realized std::function is banned by the Chromium style guide.
https://chromium-cpp.appspot.com/#library-blacklist

Can you please prepare a CL that uses base::Callback instead?

Powered by Google App Engine
This is Rietveld 408576698