The --include-file/--exclude-file options do not have any effect on the output of opannotate -a or opannotate -a -s.
The expected result would be that you could use source files or binaries (executable itself or .so files) to select what you did and did not want to see annotations for.
This is an odd omission given that --include-symbols and --exclude-symbols do work with opannotate -a. At the very least, the documentation for what does and doesn't work with include/exclude file/symbol could be a little more clear.
The way that the include/exclude file matches against path and file, and the fact that excludes are applied first, then includes, meaning that include-file can't add back something that's already been excluded.
The --include-file/--exclude-file options of opannotate only apply to the "--source" option; i.e., exclusion/inclusion is not supported for "--assembly" or mixed assembly/source. These options can be used as follows to filter in or filter out source files in the output:
The 'opreport -lg --long-filenames" command can be used to see the full pathnames of source files that would normally be included in 'opannotate --source'.
The man page and user manual will be updated to better document these options.
I have updated the man page and user guide as mentioned above, and I also added a check in the code so that we'll exit with an informative error message if either the --exclude-file or --include-file option is used with the --assembly option. See the attaced patch.
I've reviewed the man pages and the change to report that --assembly and --exclude/include-file are not compatible. Much more clear how to use this now.
The patch has been committed upstream.