tree: d6230d14f00dfb2f4901c15ecc010d1034f7eded [path history] [tgz]
  1. BUILD.gn
  2. DEPS
  3. README.md
  4. auditor_result.cc
  5. auditor_result.h
  6. instance.cc
  7. instance.h
  8. safe_list.txt
  9. tests/
  10. traffic_annotation_auditor.cc
  11. traffic_annotation_auditor.h
  12. traffic_annotation_auditor_ui.cc
  13. traffic_annotation_auditor_unittest.cc
  14. traffic_annotation_exporter.cc
  15. traffic_annotation_exporter.h
  16. traffic_annotation_extractor_switches.txt
  17. traffic_annotation_file_filter.cc
  18. traffic_annotation_file_filter.h
  19. traffic_annotation_id_checker.cc
  20. traffic_annotation_id_checker.h
tools/traffic_annotation/auditor/README.md

Network Traffic Annotation Auditor

This binary runs the clang tool for extraction of Network Traffic Annotations from chromium source code, collects and summarizes its outputs, and performs tests and maintanance. Please see docs/network_traffic_annotations.md for an introduction to network traffic annotations.

Usage

traffic_annotation_auditor [OPTIONS]... [path_filter]...

Extracts network traffic annotations from source files, tests them, and updates tools/traffic_annotation/summary/annotations.xml. If path filter(s) are specified, only those directories of the source will be analyzed. Run traffic_annotation_auditor --help for options.

Example: traffic_annotation_auditor --build-path=out/Debug

The binaries of this file and the clang tool are checked out into tools/traffic_annotation/bin/[platform]. This is only done for Linux and Windows platforms now and will be extended to other platforms later.

Running

Before running, you need to build the COMPLETE chromium and pass the build path to the executable.

Safe List

If there are files, paths, or specific functions that need to be exempted from all or some tests, they can be added to the safe_list.txt. The file is comma separated, specifying the safe lists based on AuditorException::ExceptionType in tools/traffic_annotation/auditor/traffic_annotation_auditor.h. Use * as wildcard for zero or more characters when specifying file paths.

Here are the exception types:

  • all: Files and paths in this category are excempted from all tests.
  • missing: Files and paths in this category can use the MISSING_TRAFFIC_ANNOTATION tag.
  • direct_assignment: The functions in this category can assign a value directly to a MutableNetworkTrafficAnnotationTag. This is controlled to avoid assigning arbitrary values to mutable annotations. The format of the entries should be full_function_name@file_path. For example: download::ProtoConversions::EntryFromProto@components/download/internal/background_service/proto_conversions.cc