You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@cloudera.org> on 2018/03/22 23:31:32 UTC

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Hello Will Berkeley,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/9773

to review the following change.


Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................

KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

The diagnostics log uses a compresssed format for storing stack traces.
While it's textual it's not really in a format that's amenable to human
consumption.

This patch adds a 'kudu diagnose parse-stacks' tool which takes a
diagnostics log and outputs a human-readable text format of all the
stack samples from the log.

Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
---
M build-support/release/rat_exclude_files.txt
M src/kudu/gutil/strings/split_internal.h
M src/kudu/tablet/compaction_policy-test.cc
M src/kudu/tools/CMakeLists.txt
M src/kudu/tools/kudu-tool-test.cc
A src/kudu/tools/testdata/bad-diagnostics-log.txt
A src/kudu/tools/testdata/sample-diagnostics-log.txt
M src/kudu/tools/tool_action.h
A src/kudu/tools/tool_action_diagnose.cc
M src/kudu/tools/tool_main.cc
M src/kudu/util/test_util.cc
M src/kudu/util/test_util.h
12 files changed, 450 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/73/9773/1
-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 8: Verified+1

Java flake. Unrelated.


-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 8
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Fri, 01 Jun 2018 17:02:40 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 2:

(11 comments)

http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/kudu-tool-test.cc
File src/kudu/tools/kudu-tool-test.cc:

http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/kudu-tool-test.cc@2821
PS2, Line 2821:       &stdout));;
Nit: extra semicolon here.


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc
File src/kudu/tools/tool_action_diagnose.cc:

http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@105
PS2, Line 105:     InsertIfNotPresent(&symbols_, addr, symbol);
If addr/symbol aren't moved, VisitSymbol should receive them by cref.


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@112
PS2, Line 112:     first_ = false;
Nit: could move to just past L110.


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@143
PS2, Line 143:   Status Parse(const std::string& line) {
Nit: don't need std:: prefix.


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@155
PS2, Line 155:     date_ = fields[0].ToString();
Nit: stylistically would prefer if Parse() didn't mutate its internal state if returning an error.


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@164
PS2, Line 164:     int64_t time_us;
             :     if (!safe_strto64(fields[3].data(), fields[3].size(), &time_us)) {
             :       return Status::InvalidArgument("invalid timestamp", fields[3].ToString());
             :     }
Why bother parsing this if we're not going to use it? Just as a sanity check?


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@188
PS2, Line 188:   string date_;
             :   string time_;
Seems like you could avoid making these copies if the ParsedLine took ownership of 'line' in Parse() and stored StringPieces here (which are just pointers into other strings, basically).


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@211
PS2, Line 211:     ParsedLine lf;
Nit: Not sure what 'lf' means here. Maybe that was from a time when ParsedLine was called something else?


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@219
PS2, Line 219:         RETURN_NOT_OK(ParseStacks(lf, &stacks_record));
For symmetry, could we make ParseStacks a non-static function and have it be responsible for invoking VisitStacksRecord?


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@231
PS2, Line 231:     CHECK(lf.type() == RecordType::kSymbols);
Can we use CHECK_EQ instead? Guessing that didn't work because there's no operator<< defined for RecordType. You could implement a simple one. See threadpool.{cc,h} for an example.


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@335
PS2, Line 335:     return Status::IOError(ErrnoToString(errno));
Does errno work in this context? Is it guaranteed to be set by the C++ stream library?



-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Wed, 23 May 2018 04:32:55 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 1:

(2 comments)

Just small nits.

http://gerrit.cloudera.org:8080/#/c/9773/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/9773/1//COMMIT_MSG@9
PS1, Line 9: s
nit: extra s


http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/kudu-tool-test.cc
File src/kudu/tools/kudu-tool-test.cc:

http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/kudu-tool-test.cc@2417
PS1, Line 2417: "t
nit: Indentation off by a tad.



-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Tue, 27 Mar 2018 18:44:11 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has uploaded a new patch set (#9) to the change originally created by Todd Lipcon. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................

KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

The diagnostics log uses a compressed format for storing stack traces.
While it's textual it's not really in a format that's amenable to human
consumption.

This patch adds a 'kudu diagnose parse_stacks' tool which takes a
diagnostics log and outputs a human-readable text format of all the
stack samples from the log.

See example output at https://gist.github.com/wdberkeley/ea27b06885138e8c80927759b31784b5

Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
---
M build-support/release/rat_exclude_files.txt
M src/kudu/gutil/strings/split_internal.h
M src/kudu/tablet/compaction_policy-test.cc
M src/kudu/tools/CMakeLists.txt
A src/kudu/tools/diagnostics_log_parser-test.cc
A src/kudu/tools/diagnostics_log_parser.cc
A src/kudu/tools/diagnostics_log_parser.h
M src/kudu/tools/kudu-tool-test.cc
A src/kudu/tools/testdata/bad-diagnostics-log.txt
A src/kudu/tools/testdata/sample-diagnostics-log.txt
M src/kudu/tools/tool_action.h
A src/kudu/tools/tool_action_diagnose.cc
M src/kudu/tools/tool_main.cc
M src/kudu/util/test_util.cc
M src/kudu/util/test_util.h
15 files changed, 819 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/73/9773/9
-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 9
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 4:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/9773/4/src/kudu/tools/tool_action_diagnose.cc
File src/kudu/tools/tool_action_diagnose.cc:

http://gerrit.cloudera.org:8080/#/c/9773/4/src/kudu/tools/tool_action_diagnose.cc@147
PS4, Line 147:   const string kUnknown = "<unknown>";
> It was a little confusing to me that kUnknown is both a const string privat
Done


http://gerrit.cloudera.org:8080/#/c/9773/4/src/kudu/tools/tool_action_diagnose.cc@253
PS4, Line 253: lf
> nit: why lf instead of pl?
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 4
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Fri, 01 Jun 2018 15:22:02 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 4:

Looks good though I'd still like to see some additional JSON parsing unit tests.


-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 4
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Wed, 30 May 2018 17:11:53 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 9: Code-Review+2

New unit test looks shiny. Thanks.


-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 9
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Fri, 01 Jun 2018 19:13:06 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 4:

Ah, I forgot about that. Thanks for reminding me. I will get to that as soon as I can.


-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 4
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Wed, 30 May 2018 17:12:52 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 9: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 9
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Tue, 05 Jun 2018 17:33:13 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has uploaded a new patch set (#5) to the change originally created by Todd Lipcon. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................

KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

The diagnostics log uses a compressed format for storing stack traces.
While it's textual it's not really in a format that's amenable to human
consumption.

This patch adds a 'kudu diagnose parse_stacks' tool which takes a
diagnostics log and outputs a human-readable text format of all the
stack samples from the log.

See example output at https://gist.github.com/wdberkeley/ea27b06885138e8c80927759b31784b5

Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
---
M build-support/release/rat_exclude_files.txt
M src/kudu/gutil/strings/split_internal.h
M src/kudu/tablet/compaction_policy-test.cc
M src/kudu/tools/CMakeLists.txt
M src/kudu/tools/kudu-tool-test.cc
A src/kudu/tools/testdata/bad-diagnostics-log.txt
A src/kudu/tools/testdata/sample-diagnostics-log.txt
M src/kudu/tools/tool_action.h
A src/kudu/tools/tool_action_diagnose.cc
M src/kudu/tools/tool_main.cc
M src/kudu/util/test_util.cc
M src/kudu/util/test_util.h
12 files changed, 182 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/73/9773/5
-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 5
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc
File src/kudu/tools/tool_action_diagnose.cc:

http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@188
PS2, Line 188:     } else {
             :       type_ = R
> Well, LogParser won't be taking ownership of part of the stream; ParsedLine
Done


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@335
PS2, Line 335:          ++group) {
> Can you show me how you reached that conclusion? Not saying you're wrong; I
There's discussion and reports of what people have tried here: https://stackoverflow.com/questions/17337602/how-to-get-error-message-when-ifstream-open-fails. The general conclusion being all error reporting appears to be somewhat implementation-dependent. Related questions report the same thing, and that the stream library was apparently designed before errors were discovered since there's no clear way to get at them. man 3 errno on Linux seems to promise all syscalls will set the value on error; I can't find a clear statement of something similar about macos but people report it works on SO.

So mostly I'm going by what people say on SO.



-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 3
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Wed, 30 May 2018 08:17:38 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/9773/8/src/kudu/tools/diagnostics_log_parser-test.cc
File src/kudu/tools/diagnostics_log_parser-test.cc:

PS8: 
Much of the parsing code returns InvalidArgument on failure, so for negative test cases, can you test the stringified Status to make sure the InvalidArgument error you got is the one you expected to get?



-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 8
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Fri, 01 Jun 2018 17:33:19 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has uploaded a new patch set (#3) to the change originally created by Todd Lipcon. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................

KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

The diagnostics log uses a compressed format for storing stack traces.
While it's textual it's not really in a format that's amenable to human
consumption.

This patch adds a 'kudu diagnose parse_stacks' tool which takes a
diagnostics log and outputs a human-readable text format of all the
stack samples from the log.

See example output at https://gist.github.com/wdberkeley/ea27b06885138e8c80927759b31784b5

Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
---
M build-support/release/rat_exclude_files.txt
M src/kudu/gutil/strings/split_internal.h
M src/kudu/tablet/compaction_policy-test.cc
M src/kudu/tools/CMakeLists.txt
M src/kudu/tools/kudu-tool-test.cc
A src/kudu/tools/testdata/bad-diagnostics-log.txt
A src/kudu/tools/testdata/sample-diagnostics-log.txt
M src/kudu/tools/tool_action.h
A src/kudu/tools/tool_action_diagnose.cc
M src/kudu/tools/tool_main.cc
M src/kudu/util/test_util.cc
M src/kudu/util/test_util.h
12 files changed, 477 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/73/9773/3
-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 3
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 7:

Had to rework quite a bit to fit in unit tests for the parsing.


-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 7
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Fri, 01 Jun 2018 09:33:03 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 2:

(11 comments)

Didn't add any extra test for the JSON visiting yet.

http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/kudu-tool-test.cc
File src/kudu/tools/kudu-tool-test.cc:

http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/kudu-tool-test.cc@2821
PS2, Line 2821:       &stdout));;
> Nit: extra semicolon here.
Done


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc
File src/kudu/tools/tool_action_diagnose.cc:

http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@105
PS2, Line 105:     InsertIfNotPresent(&symbols_, addr, symbol);
> If addr/symbol aren't moved, VisitSymbol should receive them by cref.
Done


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@112
PS2, Line 112:     first_ = false;
> Nit: could move to just past L110.
I'm not following. That would result in first_ being true always.


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@143
PS2, Line 143:   Status Parse(const std::string& line) {
> Nit: don't need std:: prefix.
Done


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@155
PS2, Line 155:     date_ = fields[0].ToString();
> Nit: stylistically would prefer if Parse() didn't mutate its internal state
Done


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@164
PS2, Line 164:     int64_t time_us;
             :     if (!safe_strto64(fields[3].data(), fields[3].size(), &time_us)) {
             :       return Status::InvalidArgument("invalid timestamp", fields[3].ToString());
             :     }
> Why bother parsing this if we're not going to use it? Just as a sanity chec
Right now it's a sanity check but it should be used later when we parse and do things with the metrics that are also in the log.

I added a note to this effect.


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@188
PS2, Line 188:   string date_;
             :   string time_;
> Seems like you could avoid making these copies if the ParsedLine took owner
That's true, though we'd still make a copy of the JSON payload unless the TODO is addressed. Do you think it's worth it? My reservation is that it goes against my intuition for a parser to take ownership of part of the stream it is parsing, and there's no need for the extra efficiency here AFAICT.


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@211
PS2, Line 211:     ParsedLine lf;
> Nit: Not sure what 'lf' means here. Maybe that was from a time when ParsedL
Done


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@219
PS2, Line 219:         RETURN_NOT_OK(ParseStacks(lf, &stacks_record));
> For symmetry, could we make ParseStacks a non-static function and have it b
Done


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@231
PS2, Line 231:     CHECK(lf.type() == RecordType::kSymbols);
> Can we use CHECK_EQ instead? Guessing that didn't work because there's no o
Done


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@335
PS2, Line 335:     return Status::IOError(ErrnoToString(errno));
> Does errno work in this context? Is it guaranteed to be set by the C++ stre
After a bit of searching, it's seems like probably it's not guaranteed to be set by the C++ standard, but on Linux and macos we can count on it being set.



-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Wed, 23 May 2018 21:03:31 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 3:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc
File src/kudu/tools/tool_action_diagnose.cc:

http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@112
PS2, Line 112: };
> I'm not following. That would result in first_ being true always.
Brain fart; I didn't see the negation on the condition in L109.


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@188
PS2, Line 188:     } else {
             :       type_ = R
> That's true, though we'd still make a copy of the JSON payload unless the T
Well, LogParser won't be taking ownership of part of the stream; ParsedLine will, which sorta makes sense (since it's taking ownership over "its" line).

As for efficiency, how large are the metrics logs? If they're big, or if the tool is expected to be used against many of them, extra efficiency would be appreciated.


http://gerrit.cloudera.org:8080/#/c/9773/2/src/kudu/tools/tool_action_diagnose.cc@335
PS2, Line 335:          ++group) {
> After a bit of searching, it's seems like probably it's not guaranteed to b
Can you show me how you reached that conclusion? Not saying you're wrong; I just want to better understand myself.



-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 3
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Wed, 23 May 2018 21:53:08 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has uploaded a new patch set (#4) to the change originally created by Todd Lipcon. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................

KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

The diagnostics log uses a compressed format for storing stack traces.
While it's textual it's not really in a format that's amenable to human
consumption.

This patch adds a 'kudu diagnose parse_stacks' tool which takes a
diagnostics log and outputs a human-readable text format of all the
stack samples from the log.

See example output at https://gist.github.com/wdberkeley/ea27b06885138e8c80927759b31784b5

Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
---
M build-support/release/rat_exclude_files.txt
M src/kudu/gutil/strings/split_internal.h
M src/kudu/tablet/compaction_policy-test.cc
M src/kudu/tools/CMakeLists.txt
M src/kudu/tools/kudu-tool-test.cc
A src/kudu/tools/testdata/bad-diagnostics-log.txt
A src/kudu/tools/testdata/sample-diagnostics-log.txt
M src/kudu/tools/tool_action.h
A src/kudu/tools/tool_action_diagnose.cc
M src/kudu/tools/tool_main.cc
M src/kudu/util/test_util.cc
M src/kudu/util/test_util.h
12 files changed, 483 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/73/9773/4
-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 4
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 2:

One other comment I forgot to make earlier: it would be nice to pull out the parsing functionality and unit test it separately. There’s a lot of JSON parsing that isn’t fully covered yet, but there’s no reason it needs to be tested via running the CLI.


-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Wed, 23 May 2018 05:58:13 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has uploaded a new patch set (#6) to the change originally created by Todd Lipcon. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................

KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

The diagnostics log uses a compressed format for storing stack traces.
While it's textual it's not really in a format that's amenable to human
consumption.

This patch adds a 'kudu diagnose parse_stacks' tool which takes a
diagnostics log and outputs a human-readable text format of all the
stack samples from the log.

See example output at https://gist.github.com/wdberkeley/ea27b06885138e8c80927759b31784b5

Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
---
M build-support/release/rat_exclude_files.txt
M src/kudu/gutil/strings/split_internal.h
M src/kudu/tablet/compaction_policy-test.cc
M src/kudu/tools/CMakeLists.txt
A src/kudu/tools/diagnostics_log_parser-test.cc
A src/kudu/tools/diagnostics_log_parser.cc
A src/kudu/tools/diagnostics_log_parser.h
M src/kudu/tools/kudu-tool-test.cc
A src/kudu/tools/testdata/bad-diagnostics-log.txt
A src/kudu/tools/testdata/sample-diagnostics-log.txt
M src/kudu/tools/tool_action.h
A src/kudu/tools/tool_action_diagnose.cc
M src/kudu/tools/tool_main.cc
M src/kudu/util/test_util.cc
M src/kudu/util/test_util.h
15 files changed, 777 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/73/9773/6
-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 6
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has uploaded a new patch set (#7) to the change originally created by Todd Lipcon. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................

KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

The diagnostics log uses a compressed format for storing stack traces.
While it's textual it's not really in a format that's amenable to human
consumption.

This patch adds a 'kudu diagnose parse_stacks' tool which takes a
diagnostics log and outputs a human-readable text format of all the
stack samples from the log.

See example output at https://gist.github.com/wdberkeley/ea27b06885138e8c80927759b31784b5

Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
---
M build-support/release/rat_exclude_files.txt
M src/kudu/gutil/strings/split_internal.h
M src/kudu/tablet/compaction_policy-test.cc
M src/kudu/tools/CMakeLists.txt
A src/kudu/tools/diagnostics_log_parser-test.cc
A src/kudu/tools/diagnostics_log_parser.cc
A src/kudu/tools/diagnostics_log_parser.h
M src/kudu/tools/kudu-tool-test.cc
A src/kudu/tools/testdata/bad-diagnostics-log.txt
A src/kudu/tools/testdata/sample-diagnostics-log.txt
M src/kudu/tools/tool_action.h
A src/kudu/tools/tool_action_diagnose.cc
M src/kudu/tools/tool_main.cc
M src/kudu/util/test_util.cc
M src/kudu/util/test_util.h
15 files changed, 772 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/73/9773/7
-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 7
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................

KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

The diagnostics log uses a compressed format for storing stack traces.
While it's textual it's not really in a format that's amenable to human
consumption.

This patch adds a 'kudu diagnose parse_stacks' tool which takes a
diagnostics log and outputs a human-readable text format of all the
stack samples from the log.

See example output at https://gist.github.com/wdberkeley/ea27b06885138e8c80927759b31784b5

Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Reviewed-on: http://gerrit.cloudera.org:8080/9773
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <to...@apache.org>
---
M build-support/release/rat_exclude_files.txt
M src/kudu/gutil/strings/split_internal.h
M src/kudu/tablet/compaction_policy-test.cc
M src/kudu/tools/CMakeLists.txt
A src/kudu/tools/diagnostics_log_parser-test.cc
A src/kudu/tools/diagnostics_log_parser.cc
A src/kudu/tools/diagnostics_log_parser.h
M src/kudu/tools/kudu-tool-test.cc
A src/kudu/tools/testdata/bad-diagnostics-log.txt
A src/kudu/tools/testdata/sample-diagnostics-log.txt
M src/kudu/tools/tool_action.h
A src/kudu/tools/tool_action_diagnose.cc
M src/kudu/tools/tool_main.cc
M src/kudu/util/test_util.cc
M src/kudu/util/test_util.h
15 files changed, 819 insertions(+), 10 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Kudu Jenkins: Verified
  Todd Lipcon: Looks good to me, approved

-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 10
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has removed a vote on this change.

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Removed Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 8
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 1:

(1 comment)

Just passing through...

http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/tool_main.cc
File src/kudu/tools/tool_main.cc:

http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/tool_main.cc@65
PS1, Line 65:       .AddMode(BuildDiagnoseMode())
Please also update the "help" test in kudu-tool-test.



-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Thu, 22 Mar 2018 23:55:52 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 9:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/9773/8/src/kudu/tools/diagnostics_log_parser-test.cc
File src/kudu/tools/diagnostics_log_parser-test.cc:

PS8: 
> Much of the parsing code returns InvalidArgument on failure, so for negativ
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 9
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Fri, 01 Jun 2018 19:11:04 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has uploaded a new patch set (#2) to the change originally created by Todd Lipcon. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................

KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

The diagnostics log uses a compressed format for storing stack traces.
While it's textual it's not really in a format that's amenable to human
consumption.

This patch adds a 'kudu diagnose parse_stacks' tool which takes a
diagnostics log and outputs a human-readable text format of all the
stack samples from the log.

See example output at https://gist.github.com/wdberkeley/ea27b06885138e8c80927759b31784b5

Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
---
M build-support/release/rat_exclude_files.txt
M src/kudu/gutil/strings/split_internal.h
M src/kudu/tablet/compaction_policy-test.cc
M src/kudu/tools/CMakeLists.txt
M src/kudu/tools/kudu-tool-test.cc
A src/kudu/tools/testdata/bad-diagnostics-log.txt
A src/kudu/tools/testdata/sample-diagnostics-log.txt
M src/kudu/tools/tool_action.h
A src/kudu/tools/tool_action_diagnose.cc
M src/kudu/tools/tool_main.cc
M src/kudu/util/test_util.cc
M src/kudu/util/test_util.h
12 files changed, 461 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/73/9773/2
-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 1:

(10 comments)

http://gerrit.cloudera.org:8080/#/c/9773/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/9773/1//COMMIT_MSG@9
PS1, Line 9: s
> nit: extra s
Done


http://gerrit.cloudera.org:8080/#/c/9773/1//COMMIT_MSG@13
PS1, Line 13: parse-stacks
To be consistent with existing tools, the name should be parse_stacks.


http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/gutil/strings/split_internal.h
File src/kudu/gutil/strings/split_internal.h:

http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/gutil/strings/split_internal.h@28
PS1, Line 28: base
Seems this should be kudu/gutil, not base.


http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/gutil/strings/split_internal.h@260
PS1, Line 260:   operator std::array<ArrayType, ArraySize>() {
> warning: 'operator array<type-parameter-1-0, ArraySize>' must be marked exp
I actually get a compile error if I follow Tidy Bot's advice here.


http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/kudu-tool-test.cc
File src/kudu/tools/kudu-tool-test.cc:

http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/kudu-tool-test.cc@2417
PS1, Line 2417: "t
> nit: Indentation off by a tad.
Done


http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/tool_action_diagnose.cc
File src/kudu/tools/tool_action_diagnose.cc:

http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/tool_action_diagnose.cc@53
PS1, Line 53: using std::cerr;
> warning: using decl 'cerr' is unused [misc-unused-using-decls]
Again, compile error if I comply.


http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/tool_action_diagnose.cc@134
PS1, Line 134:   const string kUnknown = "<unknown>";
> warning: invalid case style for private member 'kUnknown' [readability-iden
Bit of a special case to avoid a temporary. Ignoring.


http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/tool_action_diagnose.cc@248
PS1, Line 248: StacksRecord::Group* group
Should DCHECK_NOTNULL this argument.


http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/tool_action_diagnose.cc@289
PS1, Line 289: StacksRecord* record)
Likewise.


http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/tool_main.cc
File src/kudu/tools/tool_main.cc:

http://gerrit.cloudera.org:8080/#/c/9773/1/src/kudu/tools/tool_main.cc@65
PS1, Line 65:       .AddMode(BuildDiagnoseMode())
> Please also update the "help" test in kudu-tool-test.
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Tue, 22 May 2018 06:35:48 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Mike Percy (Code Review)" <ge...@cloudera.org>.
Mike Percy has posted comments on this change. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................


Patch Set 4: Code-Review+1

(2 comments)

Looks good to me, just a couple super minor nits, feel free to ignore.

http://gerrit.cloudera.org:8080/#/c/9773/4/src/kudu/tools/tool_action_diagnose.cc
File src/kudu/tools/tool_action_diagnose.cc:

http://gerrit.cloudera.org:8080/#/c/9773/4/src/kudu/tools/tool_action_diagnose.cc@147
PS4, Line 147:   const string kUnknown = "<unknown>";
It was a little confusing to me that kUnknown is both a const string private member of this class and a class enum value in the same file. Can we rename one of them for clarity?


http://gerrit.cloudera.org:8080/#/c/9773/4/src/kudu/tools/tool_action_diagnose.cc@253
PS4, Line 253: lf
nit: why lf instead of pl?



-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 4
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Thu, 31 May 2018 22:14:00 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has uploaded a new patch set (#8) to the change originally created by Todd Lipcon. ( http://gerrit.cloudera.org:8080/9773 )

Change subject: KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log
......................................................................

KUDU-2353 (part 1): add a tool to parse stacks from diagnostics log

The diagnostics log uses a compressed format for storing stack traces.
While it's textual it's not really in a format that's amenable to human
consumption.

This patch adds a 'kudu diagnose parse_stacks' tool which takes a
diagnostics log and outputs a human-readable text format of all the
stack samples from the log.

See example output at https://gist.github.com/wdberkeley/ea27b06885138e8c80927759b31784b5

Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
---
M build-support/release/rat_exclude_files.txt
M src/kudu/gutil/strings/split_internal.h
M src/kudu/tablet/compaction_policy-test.cc
M src/kudu/tools/CMakeLists.txt
A src/kudu/tools/diagnostics_log_parser-test.cc
A src/kudu/tools/diagnostics_log_parser.cc
A src/kudu/tools/diagnostics_log_parser.h
M src/kudu/tools/kudu-tool-test.cc
A src/kudu/tools/testdata/bad-diagnostics-log.txt
A src/kudu/tools/testdata/sample-diagnostics-log.txt
M src/kudu/tools/tool_action.h
A src/kudu/tools/tool_action_diagnose.cc
M src/kudu/tools/tool_main.cc
M src/kudu/util/test_util.cc
M src/kudu/util/test_util.h
15 files changed, 772 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/73/9773/8
-- 
To view, visit http://gerrit.cloudera.org:8080/9773
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic5969cb3a54f691356e9cd3add150e717538a687
Gerrit-Change-Number: 9773
Gerrit-PatchSet: 8
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>