New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 689585 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature



Sign in to add a comment

generate_logs: should use debugd callbacks for log generation

Project Member Reported by vapier@chromium.org, Feb 7 2017

Issue description

the `generate_logs` script is a standalone file that isn't executed by any code.  developers will sometimes run it by hand to generate a tarball of interesting log files for later analysis.

the trouble is that it duplicates a lot of the log gathering logic already in debugd (which is reachable via a dbus callback).  so when people try to debug things, depending on where they got their logs, they have an inconsistent set of files.

further, when we change one place, we often don't update both, which further leads to divergence in quality of logs.

since accessing the dbus endpoint isn't exactly trivial, let's rewrite generate_logs in C++ and have it produce a tarball from the debugd dbus callback.  if people find the new generate_logs output to be lacking, we can update debugd to include the missing bits.

creating a tarball from the dbus results can be a little awkward.  we'd either depend on libarchive (while small <1mb, nothing else really pulls it in), or we can generate the tar format ourselves.  i looked into this and it's actually pretty trivial to do so -- less than 100 lines actually.
 
Cc: dnschn...@chromium.org
Does debugd collect archived messages.* files?  I sometimes use generate_logs because I've heard feedback doesn't pick up all the files there.

Comment 3 by vapier@google.com, Feb 7 2017

you can go to chrome://net-internals/#chromeos and run the Store Debug Logs link to see what it grabs
Oh, I just ran

dbus-send --system --dest=org.chromium.debugd --type=method_call --print-reply /org/chromium/debugd org.chromium.debugd.GetAllLogs

and found that it doesn't have the contents of messages.7 for me.
Looks like that entry in the debugd implementation is:

  { "syslog", "/usr/share/userfeedback/scripts/getmsgs --last '2 hours'"
              " /var/log/messages" },

So if I can trust whatever "getmsgs" is, then perhaps messages.7 was more than 2 hours ago?

I suspect we can survive without >2 hour old logs, perhaps?
Depends on how obscure an issue you want to track down, I suppose.

In my case, I file feedback for normal issues, and run generate_logs when I want to slurp up every log possible for the stranger issues.  It seems like a step backwards to not have an automated way to collect as much data as possible on dev machines.

Comment 7 by vapier@google.com, Feb 7 2017

i missed we have a DumpDebugLogs end point in debugd already that can produce a tarball, so i don't have to manually unpack anything.  this will be equiv to chrome://net-internals/#chromeos output.

if you think that debug log could have more info added to it, then we can evaluate each request.  having a sep script that no one watches over is already backwards.
Searching through my emails for use cases of generate_logs:

* un-uploaded crashes (would be nice if all recent crash IDs were included in the dump)
* From rockchip: "please upload generate_logs, it may contains kcrashes" (pretty sure this is already included)
* /var/log/bluetooth.log 
i've moved the bundling of crashes to issue 690134

wrt bluetooth.log, i don't see that file, nor do i find any references to it.  you sure it's a thing ?
Oh no, sorry. It was a modification in https://code.google.com/p/chrome-os-partner/issues/detail?id=60852 that generated it.
Project Member

Comment 11 by bugdroid1@chromium.org, Feb 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/f8ca532441badb955e0e39c1cb02c9810af31145

commit f8ca532441badb955e0e39c1cb02c9810af31145
Author: Mike Frysinger <vapier@chromium.org>
Date: Fri Feb 10 04:48:51 2017

debugd: add a generate_logs helper

This replaces the `generate_logs` shell script that is not well
maintained or integrated into the rest of the system.

BUG= chromium:689585 
TEST=ran generate_logs on a system with diff command line options

Change-Id: I8657d0e92b59ae57e5325b5de99837601ea9b823
Reviewed-on: https://chromium-review.googlesource.com/439464
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>

[modify] https://crrev.com/f8ca532441badb955e0e39c1cb02c9810af31145/debugd/debugd.gyp
[add] https://crrev.com/f8ca532441badb955e0e39c1cb02c9810af31145/debugd/tools/generate_logs.cc

Project Member

Comment 12 by bugdroid1@chromium.org, Feb 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/126a9a66693e632988cf0535c811202451bdf26a

commit 126a9a66693e632988cf0535c811202451bdf26a
Author: Mike Frysinger <vapier@chromium.org>
Date: Sat Feb 11 08:35:24 2017

debugd: integrate `generate_logs`

We don't load the workarounds script from crosh anymore,
so there's no need to depend on it.

That leaves the `generate_logs` helper script.  Some people want
it still, so move it to debugd as an integrated+supported tool.

BUG= chromium:689585 
TEST=precq still works, as does crosh itself
TEST=generate_logs is installed and still works
CQ-DEPEND=CL:439464

Change-Id: I736fbde11590eb5dc231e3fba5fc4d1d76772a4f
Reviewed-on: https://chromium-review.googlesource.com/436445
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Luis Hector Chavez <lhchavez@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>

[modify] https://crrev.com/126a9a66693e632988cf0535c811202451bdf26a/chromeos-base/crosh/crosh-9999.ebuild
[modify] https://crrev.com/126a9a66693e632988cf0535c811202451bdf26a/chromeos-base/debugd/debugd-9999.ebuild

Project Member

Comment 13 by bugdroid1@chromium.org, Feb 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/896aa96f2e6e43fac0f317d28527001442e18970

commit 896aa96f2e6e43fac0f317d28527001442e18970
Author: Mike Frysinger <vapier@chromium.org>
Date: Sat Feb 11 21:06:38 2017

workarounds: drop package

Now that debugd has replaced this and nothing depends on it, drop it.

BUG= chromium:689585 
TEST=precq passes
CQ-DEPEND=CL:436445

Change-Id: I51b19430c6698799770308115bd159ef53837a31
Reviewed-on: https://chromium-review.googlesource.com/438586
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>

[delete] https://crrev.com/88bfd11137abbd9bc5457af39b37b7be2a7938c8/chromeos-base/workarounds/workarounds-0.0.1-r84.ebuild
[delete] https://crrev.com/88bfd11137abbd9bc5457af39b37b7be2a7938c8/chromeos-base/workarounds/workarounds-9999.ebuild

Project Member

Comment 14 by bugdroid1@chromium.org, Feb 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/manifest/+/452555075b07bf114c7da4dedcc66678c02953fb

commit 452555075b07bf114c7da4dedcc66678c02953fb
Author: Mike Frysinger <vapier@chromium.org>
Date: Sun Feb 12 02:12:14 2017

workarounds: drop repo

We've dropped the only ebuild that referred to this repo.

BUG= chromium:689585 
TEST=precq passes
CQ-DEPEND=CL:438586

Change-Id: I65b04fe876723e9080147daafbb15b4086aabcfa
Reviewed-on: https://chromium-review.googlesource.com/438867
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>

[modify] https://crrev.com/452555075b07bf114c7da4dedcc66678c02953fb/full.xml

Project Member

Comment 15 by bugdroid1@chromium.org, Feb 12 2017

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/chromeos/manifest-internal/+/a8517482632fd4e464450bc7fa8c62e0306c774e

commit a8517482632fd4e464450bc7fa8c62e0306c774e
Author: Mike Frysinger <vapier@chromium.org>
Date: Sun Feb 12 02:12:14 2017

Status: Fixed (was: Available)

Comment 17 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 18 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Status: Assigned (was: Fixed)
generate_logs command always creating the debug log file in "/tmp" folder. --output option is not working.

command: generate_logs --output /home/chronos/user/Downloads
Result: Debug log is created in /tmp folder.



Status: Fixed (was: Assigned)
please file a new bug.  we don't want to keep re-opening this whenever we noticed something different.
Status: Verified (was: Fixed)

Sign in to add a comment