Bug 10099 - Clarifying and fleshing out debugging with 'bitbake -e'
Summary: Clarifying and fleshing out debugging with 'bitbake -e'
Status: RESOLVED FIXED
Alias: None
Product: Reference
Classification: Documentation
Component: handbook (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 2.2 M4
Assignee: Scott Rifenbark
QA Contact:
URL:
Whiteboard: 08 August 2016: RESOLVED
Depends on:
Blocks:
 
Reported: 2016-08-08 20:42 UTC by ulfalizer
Modified: 2016-08-08 21:43 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Done (doc changes complete)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ulfalizer 2016-08-08 20:42:57 UTC
I suggest the following changes. 'bitbake -e' is a very important debugging
aid, hence why I think it should be moved earlier. I have also seen people
being confused about the "scope" of variables, so I'll piggyback a note that
might help.

* Rename '2.3.1. Task Failures' to '2.3.1. Viewing logs from failed tasks'.

* Move '2.3.8 Variables' to 2.3.2. and rename it to '2.3.2. Viewing variable
values' (this makes it consistent with 2.3.1). Rewrite it like this to clarify
and flesh it out:

  BitBake's -e option is used to display variable values after parsing. The
  following command displays the variable values after the configuration
  (local.conf, bblayers.conf, etc.) has been parsed.
  
      $ bitbake -e
  
  The following command displays variable values after a specific recipe
  has been parsed. This includes variables from the configuration as well.
  
      $ bitbake -e recipename
  
  Note {
  Each recipe has its own private set of variables (datastore). Internally, after
  parsing the configuration, a copy of the resulting datastore is made prior to
  parsing each recipe. This implies that variables set in one recipe won't be
  visible to other recipes.
  
  Likewise, each task within a recipe gets a private datastore based on the
  recipe datastore, meaning variables set within one task won't be visible to
  other tasks.
  }
  
  In the output of bitbake -e, each variable is preceded by a description of
  how the variable got its value, including temporary values that were later
  overriden. This description also includes variable flags (varflags) set on
  the variable. This can be a very handy debugging aid.


Cheers,
Ulf
Comment 1 ulfalizer 2016-08-08 21:10:28 UTC
Here's another thing that could be added to the end. I picked CC since it's an important variable.

  Variables that are exported to the environment are preceded by 'export' in
  the output of 'bitbake -e', like in the example below.
  
    export CC="i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/ulf/poky/build/tmp/sysroots/qemux86"
Comment 2 Scott Rifenbark 2016-08-08 21:17:23 UTC
Ulf, 

See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#usingpoky-debugging-viewing-logs-from-failed-tasks for the rename of the log section.

See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#usingpoky-debugging-viewing-variable-values for the renamed and repositions section on viewing variable values.

Thanks, 
Scott
Comment 3 ulfalizer 2016-08-08 21:20:33 UTC
"The output can be a very help during debugging."

Looks fine other than that. :)

Note the 'export' section I added too.

Thanks,
Ulf
Comment 5 ulfalizer 2016-08-08 21:27:22 UTC
Looks good now!

Thanks,
Ulf
Comment 6 Scott Rifenbark 2016-08-08 21:43:28 UTC
Thanks - resetting doc flag and putting as RESOLVED

Scott