New issue
Advanced search Search tips

Issue 720442 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Task



Sign in to add a comment

Remove DataLog / PrintStream

Project Member Reported by thakis@chromium.org, May 10 2017

Issue description

WTF has a PrintStream abstraction that isn't used a lot. Its main use seems to be in DataLog via the FilePrintStream subclass, but dataLog() isn't used very much either. It can probably be replaced just via fprintf() or maybe base's LOG stuff. This would allow us to delete ~450 lines of code for PrintStream/FilePrintStream/DataLog.
 

Comment 1 by tkent@chromium.org, May 10 2017

Agree.  It seems only String::Show() uses these classes, and LOG is appropriate for it.


Comment 2 by tkent@chromium.org, May 10 2017

BTW, [1] says "keep" for DataLog.

[1] https://docs.google.com/spreadsheets/d/1-OyE2MgypFI5B-GfqFGRLgPtpa_aBaFC_uyh9rdIq3g/edit#gid=0

yutak@, what do you think?

Project Member

Comment 3 by bugdroid1@chromium.org, May 11 2017

Comment 4 by yutak@chromium.org, May 12 2017

Cc: yutak@chromium.org
Well, I don't precisely remember why I said KEEP for this, but if we can remove
all the call sites, I'm actually happy to get them removed.

DataLog/PrintStream is a weird form of logging, and we really should use
DVLOG() or similar for this.
Status: Started (was: Untriaged)
I'll take a look at this :) Removing things from WTF sounds good.
Cc: slangley@chromium.org
Owner: sashab@chromium.org
Status: Available (was: Started)
Summary: Remove DataLog / PrintStream (was: Remove DataLog / PrintStream?)

Comment 9 by tkent@chromium.org, Mar 19 2018

Cc: jbroman@chromium.org
PrintStream is now gone (and DataLogF just forwards to vfprintf): https://chromium.googlesource.com/chromium/src/+/eb319ef351f3b12ff5d1456ea84c8c000437704c

Not clear to me how valuable the remainder of DataLog is (though it's not too hard to rig up again after killing it if someone wants to).

Comment 11 by tkent@chromium.org, Mar 20 2018

Components: Blink>MemoryAllocator>GarbageCollection
Labels: Hotlist-CodeHealth
We should replace the remainder of DataLog with base/logging.h, and remove it.

Add Blink>MemoryAllocator>GC because platform/heap/ uses DataLog a lot.

Project Member

Comment 12 by bugdroid1@chromium.org, Mar 22 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8da8c0ec223b33963b389ab3ed08be226adcadcc

commit 8da8c0ec223b33963b389ab3ed08be226adcadcc
Author: Kent Tamura <tkent@chromium.org>
Date: Thu Mar 22 07:24:42 2018

Deprecate platform/wtf/DataLog.*

- Rename DataLogF() to DeprecatedDataLogF().

- Remove commented-out code in Heap.cpp

- Prevent us from adding new dependencies on DataLog.h

This CL has no behavior changes.

Bug:  720442 
Change-Id: I188ef5a69f3426b8b49eea508e50f68fa744f7a0
Reviewed-on: https://chromium-review.googlesource.com/974807
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Yuta Kitamura <yutak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545001}
[modify] https://crrev.com/8da8c0ec223b33963b389ab3ed08be226adcadcc/third_party/WebKit/Source/DEPS
[modify] https://crrev.com/8da8c0ec223b33963b389ab3ed08be226adcadcc/third_party/WebKit/Source/platform/heap/Heap.cpp
[modify] https://crrev.com/8da8c0ec223b33963b389ab3ed08be226adcadcc/third_party/WebKit/Source/platform/heap/HeapCompact.h
[modify] https://crrev.com/8da8c0ec223b33963b389ab3ed08be226adcadcc/third_party/WebKit/Source/platform/wtf/DataLog.cpp
[modify] https://crrev.com/8da8c0ec223b33963b389ab3ed08be226adcadcc/third_party/WebKit/Source/platform/wtf/DataLog.h
[modify] https://crrev.com/8da8c0ec223b33963b389ab3ed08be226adcadcc/third_party/WebKit/Source/platform/wtf/HashTable.cpp
[modify] https://crrev.com/8da8c0ec223b33963b389ab3ed08be226adcadcc/third_party/WebKit/Source/platform/wtf/text/WTFString.cpp

Project Member

Comment 13 by bugdroid1@chromium.org, Mar 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/93bd4f78e543d50840216a05553d9513d470c101

commit 93bd4f78e543d50840216a05553d9513d470c101
Author: Kent Tamura <tkent@chromium.org>
Date: Fri Mar 23 04:24:35 2018

Remove DeprecatedDataLogF() usage in HashTable.cpp.

This CL replaces DeprecatedDataLogF() in HashTable.cpp with
DLOG(INFO). The output of DumpStats() will be changed as follows:

Before this CL:
----------------------------------------------------------------
WTF::HashTable statistics

31 accesses
2 total collisions, average 1.06 probes per access
longest collision chain: 2
  1 lookups with exactly 1 collisions (0.00% , 3.23% with this many or more)
  1 lookups with exactly 2 collisions (3.23% , 3.23% with this many or more)
2 rehashes
4 reinserts

----------------------------------------------------------------

After this CL:
----------------------------------------------------------------
[2685:85251:0323/103901.981197:INFO:HashTable.cpp(84)] WTF::HashTable statistics:
    31 accesses
    2 total collisions, average 1.06 probes per access
    longest collision chain: 2
      1 lookups with exactly 1 collisions (0.00% , 3.23% with this many or more)
      1 lookups with exactly 2 collisions (3.23% , 3.23% with this many or more)
    2 rehashes
    4 reinserts
----------------------------------------------------------------

Bug:  720442 
Change-Id: Idc2bee40a770e50a552cbb84d84722ece0630b52
Reviewed-on: https://chromium-review.googlesource.com/977182
Commit-Queue: Yuta Kitamura <yutak@chromium.org>
Reviewed-by: Yuta Kitamura <yutak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545366}
[modify] https://crrev.com/93bd4f78e543d50840216a05553d9513d470c101/third_party/WebKit/Source/platform/wtf/HashTable.cpp

Project Member

Comment 14 by bugdroid1@chromium.org, Mar 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/de039a5206d1ff4a0cf9ab2ee2ae639d67ca19e7

commit de039a5206d1ff4a0cf9ab2ee2ae639d67ca19e7
Author: Kent Tamura <tkent@chromium.org>
Date: Fri Mar 23 04:25:01 2018

Remove DeprecatedDataLogF() usage in WTFString.cpp.

String::Show() uses operator<< instead.

Bug:  720442 
Change-Id: I2053f3c12f81bd0f30c164cda3b409f0cb1fd593
Reviewed-on: https://chromium-review.googlesource.com/977185
Commit-Queue: Yuta Kitamura <yutak@chromium.org>
Reviewed-by: Yuta Kitamura <yutak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545367}
[modify] https://crrev.com/de039a5206d1ff4a0cf9ab2ee2ae639d67ca19e7/third_party/WebKit/Source/platform/wtf/text/WTFString.cpp

Comment 16 by tkent@chromium.org, Mar 26 2018

Status: Fixed (was: Available)

Sign in to add a comment