tp: fix compile of TP from external project using Bazel

Because Bazel has very complicated sandboxing, it's possible that
the tools script and the sources are not in the same director tree
leading to outputting headers in the wrong directory.

Workaround this by looking for "/src" and then using that as the root.
While hacky, it's pragmatically the easiest way to find the root of
the sources without having to do a ton of plumbing and risking
breaking the myriad of other configs we build under

Fixes: https://github.com/google/perfetto/issues/772
Change-Id: I2b0acd27a19e81f988b6511edf7c9dc7f958920d
diff --git a/tools/gen_tp_table_headers.py b/tools/gen_tp_table_headers.py
index f15245e..91e4cdb 100755
--- a/tools/gen_tp_table_headers.py
+++ b/tools/gen_tp_table_headers.py
@@ -72,7 +72,8 @@
   ]
   headers: Dict[str, Header] = {}
   for table in parse_tables_from_modules(modules):
-    input_path = os.path.relpath(table.table.python_module, ROOT_DIR)
+    raw_path = table.table.python_module
+    input_path = raw_path[raw_path.rfind('/src') + 1:]
     header = headers.get(input_path, Header([]))
     header.tables.append(table)
     headers[input_path] = header