{"id":22668219,"url":"https://github.com/lanl/byfl","last_synced_at":"2025-04-12T11:03:53.857Z","repository":{"id":4068858,"uuid":"5173183","full_name":"lanl/Byfl","owner":"lanl","description":"Program analysis tool based on software performance counters","archived":false,"fork":false,"pushed_at":"2021-05-13T21:40:09.000Z","size":1994,"stargazers_count":56,"open_issues_count":5,"forks_count":15,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-11-20T13:40:25.051Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lanl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-25T00:53:16.000Z","updated_at":"2024-08-12T19:11:05.000Z","dependencies_parsed_at":"2022-08-18T11:21:24.677Z","dependency_job_id":null,"html_url":"https://github.com/lanl/Byfl","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2FByfl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2FByfl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2FByfl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2FByfl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lanl","download_url":"https://codeload.github.com/lanl/Byfl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228911888,"owners_count":17990774,"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-12-09T15:14:08.999Z","updated_at":"2024-12-09T15:14:09.625Z","avatar_url":"https://github.com/lanl.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Byfl: Compiler-based Application Analysis\n=========================================\n\nDescription\n-----------\n\nByfl helps application developers understand code performance in a _hardware-independent_ way.  The idea is that it instruments your code at compile time then gathers and reports data at run time.  For example, suppose you wanted to know how many bytes are accessed by the following C code:\n```C\ndouble array[100000][100];\nvolatile double sum = 0.0;\n\nfor (int row=0; row\u003c100000; row++)\n  sum += array[row][0];\n```\n\nReading the hardware performance counters (e.g., using [PAPI](http://icl.cs.utk.edu/papi/)) can be misleading.  The performance counters on most processors tally not the number of bytes but rather the number of cache-line accesses.  Because the array is stored in row-major order, each access to `array` will presumably reference a different cache line while each access to `sum` will presumably reference the same cache line.\n\nByfl performs the moral equivalent of transforming the code into the following:\n```C\nunsigned long int bytes accessed = 0;\ndouble array[100000][100];\nvolatile double sum = 0.0;\n\nfor (int row=0; row\u003c100000; row++) {\n  sum += array[row][0];\n  bytes_accessed += 3*sizeof(double);\n}\n```\n\nIn the above, one can consider the `bytes_accessed` variable as a \"software performance counter,\" as it is maintained entirely by software.\n\nIn practice, however, Byfl doesn't do source-to-source transformations (unlike, for example, [ROSE](http://www.rosecompiler.org/)) as implied by the preceding code sample.  Instead, it integrates into the [LLVM compiler infrastructure](http://www.llvm.org/) as an LLVM compiler pass.  Because Byfl instruments code in LLVM's intermediate representation (IR), not native machine code, it outputs the same counter values regardless of target architecture.  In contrast, binary-instrumentation tools such as [Pin](https://software.intel.com/en-us/articles/pin-a-dynamic-binary-instrumentation-tool) may tally operations differently on different platforms.\n\nThe name \"Byfl\" comes from \"bytes/flops\".  The very first version of the code counted only bytes and floating-point operations (flops).\n\nInstallation\n------------\n\nOnce you've downloaded Byfl, the usual [CMake](https://cmake.org/) build procedure,\n```bash\ncd Byfl\nmkdir build\ncd build\ncmake ..\nmake\nmake install\n```\nshould work, although, depending on your LLVM/Clang installation, you may need to pass `cmake` some configuration options.  See [INSTALL.md](https://github.com/lanl/Byfl/blob/master/INSTALL.md) for a more complete explanation.\n\nDocumentation\n-------------\n\nByfl documentation is maintained in the [Byfl wiki](https://github.com/lanl/Byfl/wiki) on GitHub.\n\nCopyright and license\n---------------------\n\nTriad National Security, LLC (Triad) owns the copyright to Byfl, which it identifies internally as LA-CC-12-039.  The license is BSD-ish with a \"modifications must be indicated\" clause.  See [LICENSE.md](https://github.com/lanl/Byfl/blob/master/LICENSE.md) for the full text.\n\nContact\n-------\n\nScott Pakin, [_pakin@lanl.gov_](mailto:pakin@lanl.gov)\n\nA list of [all contributors to Byfl](https://github.com/lanl/Byfl/wiki/contributors) is available online.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanl%2Fbyfl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanl%2Fbyfl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanl%2Fbyfl/lists"}