Skip to content
Snippets Groups Projects
  1. Feb 14, 2017
  2. Feb 13, 2017
  3. Feb 12, 2017
    • Nick Kralevich's avatar
      tracefs: avoid overly generic regexes · 4cae28d4
      Nick Kralevich authored
      On boot, Android runs restorecon on a number of virtual directories,
      such as /sys and /sys/kernel/debug, to ensure that the SELinux labels
      are correct. To avoid causing excessive boot time delays, the restorecon
      code aggressively prunes directories, to avoid recursing down directory
      trees which will never have a matching SELinux label.
      
      See:
      * https://android-review.googlesource.com/93401
      * https://android-review.googlesource.com/109103
      
      The key to this optimization is avoiding unnecessarily broad regular
      expressions in file_contexts. If an overly broad regex exists, the tree
      pruning code is ineffective, and the restorecon ends up visiting lots of
      unnecessary directories.
      
      The directory /sys/kernel/debug/tracing contains approximately 4500
      files normally, and on debuggable builds, this number can jump to over
      9000 files when the processing from wifi-events.rc occurs. For
      comparison, the entire /sys/kernel/debug tree (excluding
      /sys/kernel/debug/tracing) only contains approximately 8000 files. The
      regular expression "/sys/kernel(/debug)?/tracing/(.*)?" ends up matching
      a significant number of files, which impacts boot performance.
      
      Instead of using an overly broad regex, refine the regex so only the
      files needed have an entry in file_contexts. This list of files is
      essentially a duplicate of the entries in
      frameworks/native/cmds/atrace/atrace.rc .
      
      This change reduces the restorecon_recursive call for /sys/kernel/debug
      from approximately 260ms to 40ms, a boot time reduction of approximately
      220ms.
      
      Bug: 35248779
      Test: device boots, no SELinux denials, faster boot.
      Change-Id: I70f8af102762ec0180546b05fcf014c097135f3e
      4cae28d4
    • Nick Kralevich's avatar
      Don't try to relabel tracing directory am: 6ebcfe47 am: 137923a1 am: 05984847 · c9bd43d1
      Nick Kralevich authored
      am: bb19a753
      
      Change-Id: I4814247299fc156954116c8116e2d8ad3d2f5577
      c9bd43d1
    • Nick Kralevich's avatar
      Don't try to relabel tracing directory am: 6ebcfe47 am: 137923a1 · bb19a753
      Nick Kralevich authored
      am: 05984847
      
      Change-Id: Ib897f3fcc8471c1f40b85650ee6c997f2da0d9de
      bb19a753
    • Nick Kralevich's avatar
      Don't try to relabel tracing directory am: 6ebcfe47 · 05984847
      Nick Kralevich authored
      am: 137923a1
      
      Change-Id: I5748e38ffdbefa08b66132080c934c44c5d02327
      05984847
    • Nick Kralevich's avatar
      Don't try to relabel tracing directory · 137923a1
      Nick Kralevich authored
      am: 6ebcfe47
      
      Change-Id: I6999a1aaf79a559e0477166523ee71cfbfeb3a1b
      137923a1
  4. Feb 11, 2017
  5. Feb 10, 2017
Loading