{"id":21899037,"url":"https://github.com/johnsonlee/trace","last_synced_at":"2025-04-15T18:52:40.254Z","repository":{"id":144532842,"uuid":"55280702","full_name":"johnsonlee/trace","owner":"johnsonlee","description":"Gradle plugin for method tracing","archived":false,"fork":false,"pushed_at":"2016-06-01T12:07:31.000Z","size":14,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T23:51:11.874Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnsonlee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-02T06:12:14.000Z","updated_at":"2021-10-09T01:42:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"fb747956-d3c4-48ca-afed-a139b60802a7","html_url":"https://github.com/johnsonlee/trace","commit_stats":null,"previous_names":["sdklite/trace"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Ftrace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Ftrace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Ftrace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Ftrace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnsonlee","download_url":"https://codeload.github.com/johnsonlee/trace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249135671,"owners_count":21218362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T14:37:07.182Z","updated_at":"2025-04-15T18:52:40.242Z","avatar_url":"https://github.com/johnsonlee.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trace\n\nTrace is a gradle plugin for android project to trace java method invocation, it uses the [Transform API](http://tools.android.com/tech-docs/new-build-system/transform-api) and [Javassist](http://jboss-javassist.github.io/javassist/) to manipulate the bytecode, and print the java method with elapsed time to logcat.\n\n## Getting Started\n\nConfigure this `build.gradle` like this:\n\n```groovy\nbuildscript {\n    repositories {\n        mavenLocal()\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:1.5.0' // Or higher version\n        classpath 'com.sdklite.trace:gradle-plugin:0.0.2' // HERE\n    }\n}\n```\n\nThen apply the trace plugin below the android plugin\n\n```groovy\napply plugin: 'com.sdklite.trace'\n```\n\nFinally, build your project and install the application to your android device, then you can filter the logcat like this:\n\n```bash\nadb logcat -s trace\n```\n\n## Performance optimization\n\nTrace gradle plugin is useful and convinient for performance optimization by\ndumping the trace log via logcat:\n\n1. Clean logcat\n\n    ```bash\n    adb logcat -c\n    ```\n2. Launch app\n3. Dump trace log\n\n    ```bash\n    adb logcat -d -s trace | awk -F: '{print $NF}' | awk '{printf \"%s, %s\\n\", $1, substr($2, 2)}'\n    ```\n\n    or filter by elapsed time\n\n    ```bash\n    adb logcat -d -s trace | awk -F: '{print $NF}' | awk '{et=strtonum(substr($2,2)); if (et \u003e 30) { printf \"%s, %s\\n\", $1, et}}'\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnsonlee%2Ftrace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnsonlee%2Ftrace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnsonlee%2Ftrace/lists"}