[PATCH] D28836: [tsan] Provide API for libraries for race detection on custom objects
Dmitry Vyukov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 24 07:59:02 PST 2017
dvyukov added inline comments.
================
Comment at: lib/tsan/rtl/tsan_external.cc:37
+SANITIZER_INTERFACE_ATTRIBUTE
+void *__tsan_external_register_tag(const char *library_name, const char *object_type) {
+ return (void *)CreateTag(library_name, object_type);
----------------
We should not assume nor impose the two-level hierarchy of library/object_type. The less such assumptions we do the more general support we provide. There can also be library/sublibrary/object_type/object_subtype. Or, lots of libraries provide only 1 object type, then will have to do tautology like library "foobar", object type "foobar". There can also be objects with hard to identify library affiliation, for example objects provided by C/C++ language, or objects provided by OS kernel (like file descriptors). "From library OS kernel" or "from library C language" will sound quite awkward.
Just one string for object identification is enough.
It covers all of "MyLibrary::Archiver", "another_library.foo/bar", "fd", "stdout".
Repository:
rL LLVM
https://reviews.llvm.org/D28836
More information about the llvm-commits
mailing list