Joe McDonnell has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18508 )

Change subject: IMPALA-11275: write thread info to log during minidump
......................................................................


Patch Set 1:

(2 comments)

Couple initial comments

http://gerrit.cloudera.org:8080/#/c/18508/1/be/src/util/minidump.cc
File be/src/util/minidump.cc:

http://gerrit.cloudera.org:8080/#/c/18508/1/be/src/util/minidump.cc@69
PS1, Line 69: static void my_i64tohex(int64_t w, char out[]) {
            :   static const char* digits = "0123456789abcdef";
            :   for (size_t i = 0, j=64; i < 16; ++i, j -= 4) {
            :     out[i] = digits[(w>>j) & 0x0f];
            :   }
            : }
For this function, it would be useful to be able to unit test the conversion to 
hex and/or confirm that we'll get the same result as PrintId in debug-util.h.

As a specific point, at i=0, j should be 60 and at i=15, j should be 0.

One option would be for debug-util.h to add an equivalent of PrintId() tuned 
for the compromised context. i.e.

// 16 + 16 + 1 separator
#define TUNIQUE_ID_BUFFER_SIZE 33
PrintIdCompromised(const TUniqueId& id, char out[]);
(or whatever would be better names for these)

That would allow for a unit test in util/debug-util-test.cc that compares the 
representation from PrintId() to PrintIdCompromised().


http://gerrit.cloudera.org:8080/#/c/18508/1/be/src/util/minidump.cc@79
PS1, Line 79: auto
Minor style point:
We generally follow the Google C++ style guide, and we avoid using auto for 
most variable definitions.
https://google.github.io/styleguide/cppguide.html#Type_deduction

We commonly use auto for iterators, because the type definitions are pretty 
tedious and can be error prone.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iea2bdf10db29a0f8ccbe5e767b708781d42a9b8a
Gerrit-Change-Number: 18508
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Smith <michael.sm...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <joemcdonn...@cloudera.com>
Gerrit-Reviewer: Michael Smith <michael.sm...@cloudera.com>
Gerrit-Comment-Date: Wed, 11 May 2022 15:54:16 +0000
Gerrit-HasComments: Yes

Reply via email to