{"id":17982451,"url":"https://github.com/nekocode/asm-systrace","last_synced_at":"2025-10-28T17:50:24.388Z","repository":{"id":98384830,"uuid":"132334090","full_name":"nekocode/ASM-Systrace","owner":"nekocode","description":"A plugin to inject tracing code to specified methods.","archived":false,"fork":false,"pushed_at":"2018-08-21T08:09:31.000Z","size":145,"stargazers_count":37,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-20T17:23:33.657Z","etag":null,"topics":["android","gradle-plugin"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nekocode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-05-06T11:57:49.000Z","updated_at":"2023-09-08T17:40:11.000Z","dependencies_parsed_at":"2023-03-13T16:01:52.851Z","dependency_job_id":null,"html_url":"https://github.com/nekocode/ASM-Systrace","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekocode%2FASM-Systrace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekocode%2FASM-Systrace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekocode%2FASM-Systrace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekocode%2FASM-Systrace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nekocode","download_url":"https://codeload.github.com/nekocode/ASM-Systrace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245530132,"owners_count":20630498,"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":["android","gradle-plugin"],"created_at":"2024-10-29T18:14:16.399Z","updated_at":"2025-10-28T17:50:19.327Z","avatar_url":"https://github.com/nekocode.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\r\n[![Apache 2.0 License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0.html) [![Release](https://jitpack.io/v/nekocode/ASM-Systrace.svg)](https://jitpack.io/#nekocode/ASM-Systrace)\r\n\r\nThis plugin can inject `Trace.beginSection()` \u0026 `Trace.endSection` to the methods which you specify in build-time. It's useful when you want to trace the methods of third-party libraries.\r\n\r\nIn addition, this plugin supports incremental work. So its build performance is not bad.\r\n\r\n## Intergation\r\n\r\nIntergate this gralde plugin:\r\n\r\n```gradle\r\nbuildscript {\r\n    repositories {\r\n        maven { url \"https://jitpack.io\" }\r\n    }\r\n    dependencies {\r\n        classpath \"com.github.nekocode:ASM-Systrace:${lastest-verion}\"\r\n    }\r\n}\r\n```\r\n\r\nCreate a groovy script and define two filter methods inside:\r\n\r\n```groovy\r\n// Only handle the class you specify can speed up the build\r\nstatic boolean filterClass(\r\n        String className // Example: android/support/v4/app/Fragment\r\n) {\r\n    // Return true if you want to continue filter methods in this class\r\n    return className.startsWith('cn/nekocode/asm_systrace/example/SomeClass')\r\n}\r\n\r\nstatic String filterMethod(\r\n        String className, // Example: android/support/v4/app/Fragment\r\n        String methodName, // Example: getLayoutInflater\r\n        String methodDesc // Example: (Landroid/os/Bundle;)Landroid/view/LayoutInflater\r\n) {\r\n    if (methodName != 'b') return null // Retrun null to skip this method\r\n    return className.split('/').last() + '#' + methodName // Return tracing tag\r\n}\r\n```\r\n\r\nApply and configure the plugin:\r\n\r\n```gralde\r\napply plugin: 'asm-systrace'\r\n\r\nasmSystrace {\r\n    filterScript = project.file(\"filter.groovy\") // The script you created in the pervious step\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnekocode%2Fasm-systrace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnekocode%2Fasm-systrace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnekocode%2Fasm-systrace/lists"}