| 132 | |
| 133 | |
| 134 | def categorize(file_str: str, mangled: str) -> str: |
| 135 | f = file_str.lower() |
| 136 | # Only attribute to FastLED if path is actually under FastLED's source tree |
| 137 | is_fastled_path = ( |
| 138 | "/dev/1/src/" in f or "/fastled/src/" in f or "/fl/" in f or "fastled" in f |
| 139 | ) |
| 140 | if is_fastled_path: |
| 141 | for needle, cat in FL_DRIVER_FILES.items(): |
| 142 | if needle in f: |
| 143 | return cat |
| 144 | if is_fastled_path: |
| 145 | if "/task/" in f or "task/executor" in f or "coroutine" in f: |
| 146 | return "FL/Task" |
| 147 | if "/audio/" in f: |
| 148 | return "FL/Audio" |
| 149 | if "/net/" in f or "/http/" in f or "websock" in f: |
| 150 | return "FL/Net" |
| 151 | if ( |
| 152 | "pixel" in f |
| 153 | or "wave" in f |
| 154 | or "color" in f |
| 155 | or "gamma" in f |
| 156 | or "lib8tion" in f |
| 157 | ): |
| 158 | return "FL/Pixel" |
| 159 | if "/platforms/" in f and "esp32" in f: |
| 160 | return "FL/Platforms-ESP32" |
| 161 | return "FL/Other" |
| 162 | if mangled.startswith(("_ZN2fl", "fl::")): |
| 163 | # Sometimes addr2line gives '??' but mangled is fl::* |
| 164 | return "FL/Other(no-debug-info)" |
| 165 | # ESP-IDF and Arduino |
| 166 | if "esp-idf" in f or "esp_idf" in f: |
| 167 | return "ESP-IDF" |
| 168 | if "arduino" in f: |
| 169 | return "Arduino" |
| 170 | if "freertos" in f: |
| 171 | return "FreeRTOS" |
| 172 | if "lwip" in f: |
| 173 | return "LWIP" |
| 174 | if "newlib" in f or "libc" in f or "gcc" in f: |
| 175 | return "libc/libgcc" |
| 176 | if f.startswith("??"): |
| 177 | return "Unknown(no-debug)" |
| 178 | return "Other" |
| 179 | |
| 180 | |
| 181 | def main() -> int: |