Commit graph

12 commits

Author SHA1 Message Date
Ray Ye
6507f8adc3 Updating ATRACE_ASYNC_FOR_TRACK_END to not require a name argument
Bug: 230399626
Test: atest TraceDevTest
Change-Id: Ia1b39f55c96011a9672f4d5c8763044f849d0bb2
2022-04-28 18:18:57 +00:00
Ray Ye
399465a93e Added async trace functions with a track name argument
Bug: 221119585
Test: atest TraceDevTest
Change-Id: I48d9e858ce588e3735ddbbe14b1bd7c8f264cd83
2022-03-24 23:55:00 +00:00
Ray Ye
9a54240aba Added trackName as additional argument to WRITE_MSG to handle trace
messages with a track name

Bug: 220499650
Test: atest TraceDevTest
Change-Id: I3f6be6b693fb6f906b90655d5d553e853c4d4411
2022-03-17 21:40:15 +00:00
Lucas Dupin
2c2c5d998e Add instant trace methods
Bug: 207049735
Test: atest TraceDevTest
Change-Id: If2826a9bb1fb99d75ff3c9c03c16c2f5f1ec5d1b
2021-12-15 02:44:36 +00:00
Hridya Valsaraju
355ff8c7c1 libcutils must check /sys/kernel/tracing for tracefs first
Currently it falls back to /sys/kernel/tracing if debugfs is not found.
/sys/kernel/tracing must be checked first since debugfs is not allowed
to be mounted in user builds starting with Android R launching devices.

Test: manual
Change-Id: I2fb5ec91bbf7d5304a1a6efcb06530969485e78f
2020-09-14 20:04:43 +00:00
Florian Mayer
fc0adaf89e Always use shared memory for atrace.
Remove ATRACE_SHMEM macro.

Test: atrace ss
      atrace wm
      sanity check output
Bug: 137366208
Change-Id: I1b42243678b9b9a41db18e2ff8cb3cf7bde874de
2020-02-26 15:55:22 +00:00
Hridya Valsaraju
6a879b25d9 Check /sys/kernel/tracing for tracefs
When debugfs is not mounted, atrace should look for
tracefs in /sys/kernel/tracing.

Test: CtsAtraceHostTestCases
Bug: 148436518
Change-Id: I45c0e664892bcda277fd9612106ad5216aea0a1b
2020-01-30 17:38:51 -08:00
Florian Mayer
b06766cbbf Use sequence number to check if to reload atrace tags.
This is to deprecate the sysprop change notification in atrace.
After this change, processes will only update their enabled tags
at the first atrace event. Previously we reloaded the tags as a
result of the sysprop changed Binder notification, which woke up
every process in the system.

Test: adb shell su root atrace -t 10 ss
Test: #define ATRACE_SHMEM 0; adb shell su root atrace -t 10 ss

Bug: 137366208

Change-Id: Idffba5fd4ba23fba2f6b9f594365df68ac0c1626
2020-01-13 17:02:58 +00:00
Florian Mayer
ad427b74c4 Remove useless goto.
Test: build

Change-Id: Ifb8d832de1115eefbf2e09c6d5c8f03244566933
2019-10-10 18:15:24 +01:00
Paul Crowley
738adf7b46 Revert "Don't initialize atrace if it's already disabled."
This reverts commit e184423526.

Reason for revert: b/73081734
Bug: 73081734

Change-Id: I8ae835f5575292ebd3c4457ef26c2e8f98cfa11e
2018-02-08 00:49:37 +00:00
Paul Crowley
e184423526 Don't initialize atrace if it's already disabled.
For processes that start very early, atrace initialization can cause
an selinux denial, so make sure it's possible to disable it and avoid
the call to open "trace_marker".

Bug: 63927601
Test: disable atrace early in vold, ensure that selinux denial is
avoided.

Change-Id: I2422e6d0db323bc13c6d6ed1896435151fca21f7
2018-01-30 08:18:24 -08:00
Elliott Hughes
8e9aeb9053 Move libcutils source to C++.
Just the minimial changes to get this to actually build, because otherwise
we always bog down trying to rewrite everything (when the real answer
is usually "stop using libcutils, it's awful").

This doesn't move a handful of files: two are basically just BSD libc
source, a couple have outstanding code reviews, and one can be deleted
(but I'll do that in a separate change).

I'm also skipping the presubmit hooks because otherwise clang-format
wants to reformat everything. I'll follow up with that...

Bug: N/A
Test: builds
Change-Id: I06403f465b67c8e493bad466dd76b1151eed5993
2017-11-10 13:18:10 -08:00
Renamed from libcutils/trace-dev.c (Browse further)