frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•1y ago
I'd like to do some statistics over the machine code gcc generates, such as a histogram of used instructions, average volatile/preserved registers usage of functions etc. For now just x86_64 SysV-ABI would be enough.

However I'm not aware of any pre-existing tool that lets me easily do this. The options I currently see are either make gcc output assembly and write a parser for the GNU Assembler format (possibly by reusing the asm-parser of the compiler-explorer project), or write a tool that reads (disassembles) object files directly using elfutils.

Any hints, prior work, further ideas, links to useful resources, or any other kind of help would be much appreciated.

Comments

baobun•1y ago
"Static analysis" should be a relevant search term. Assuming you don't need to tie the instructions back to C code then the "gcc" part seems circumstancial for implementation? I guess you might want to parse the ASM into an Abstract Syntax Tree (AST) represenation and work on that?

If you do want to tie it back to the source, this looks relevant: http://icps.u-strasbg.fr/~pop/gcc-ast.html

phafu•1y ago
For my purpose I don't need to get back to the original source, no.

The gcc part is only relevant with regards to what dialect of assembler I need to parse. If I go that route, I'd write a parser for the GNU assembler, and that would of course work with any code in that dialect, regardless from which compiler it came from (I haven't checked whether other compilers can produce GNU assembler though).

Chinese DRAM/SSDs makers have an advantage over American and Taiwanese suppliers

https://www.tomshardware.com/pc-components/ssds/chinese-makers-of-dram-modules-ssds-have-a-seriou...
1•yogthos•1m ago•0 comments

Sankey diagram of the Democratic gubernatorial primary ranked choice tabulation

https://old.reddit.com/r/Maine/comments/1ua4e7n/sankey_diagram_of_the_democratic_gubernatorial/
3•robin_reala•9m ago•0 comments

How to write loops in Claude Code

https://techstackups.com/guides/how-to-write-loops-claude-code/
3•ritzaco•10m ago•0 comments

Host-HTML: an agent-native way of sharing HTML files

https://host-html.com/
1•phanosha•11m ago•1 comments

The CEO of Allbirds' new AI biz has a plan, but no employees

https://techcrunch.com/2026/06/19/the-ceo-of-allbirds-new-ai-biz-has-a-plan-but-no-employees/
3•gpi•12m ago•0 comments

European Delusions and Danish Drones

https://world.hey.com/dhh/european-delusions-danish-drones-a3da0d27
2•gpi•14m ago•0 comments

My agent stack for automating my personal life

https://nicolasbustamante.com/blog/how-agents-run-my-personal-life
1•azhenley•14m ago•0 comments

A Stressful Game

https://gridlockedgame.netlify.app/
1•charliemoffat•14m ago•1 comments

I feel like giving up on coding

https://reedybear.bearblog.dev/i-feel-like-giving-up-on-coding/
1•speckx•15m ago•0 comments

Zeroshot, an open-source CLI for coding-agent verification loops

https://github.com/the-open-engine/zeroshot
2•tomdps•15m ago•0 comments

NY mayor, other leaders push to ban horse-drawn carriage rides after teen death

https://www.cnn.com/2026/06/19/us/central-park-horse-carriage-ride-death-debate-hnk
1•dbvn•15m ago•1 comments

Why Do So Many Everyday Systems Feel Harder to Use Now?

https://therealitydrift.substack.com/p/reality-drift-in-everyday-life
3•realitydrift•19m ago•3 comments

Show HN: Claude Code for talking to potential customers

https://trydatapoint.com
1•yoloakki•20m ago•0 comments

The AI slop refactor wave is coming

https://old.reddit.com/r/SaaS/comments/1u6f84g/the_ai_slop_refactor_wave_is_coming_and_i_havent/
3•root-parent•20m ago•1 comments

Bcachefs exits experimental status in new 'performance release'

https://www.theregister.com/software/2026/06/19/bcachefs-exits-experimental-status-in-new-perform...
1•ofrzeta•23m ago•0 comments

DirectX Dump Files Preview Now Available

https://devblogs.microsoft.com/directx/dx-dump-files-preview/
1•ibobev•23m ago•0 comments

Blaise v0.11.0 Is Here

https://github.com/graemeg/blaise/discussions/126
1•mariuz•25m ago•0 comments

Measuring AI productivity yourself with gh, jq, and Git

https://getunblocked.com/blog/measuring-ai-productivity/
1•dennispi•26m ago•0 comments

The Accidental Framework

https://blog.tacoda.dev/the-accidental-framework-934babb6bfde
1•tacoda•26m ago•0 comments

JEP: Embed Python in Java, the Polished Way

https://github.com/ninia/JEP
1•theanonymousone•28m ago•0 comments

The Bottleneck in AI Was Never Intelligence

https://www.gailweiner.com/post/the-bottleneck-in-ai-was-never-intelligence
1•speckx•29m ago•0 comments

FlashAttention-4: Algorithm and Kernel Pipelining Co-Design

https://research.colfax-intl.com/flashattention-4-algorithm-and-kernel-pipelining-co-design-for-a...
1•skidrow•29m ago•0 comments

APTA Feature on Cellular in Transit Systems

https://aptapassengertransport.com/when-cellular-becomes-transit-infrastructure/
1•takko_the_boss•30m ago•0 comments

Why doesn't Get­Last­Input­Info() return info for the user I'm impersonating?

https://devblogs.microsoft.com/oldnewthing/20260618-00/?p=112444
1•ibobev•30m ago•0 comments

Ghost Boxes: Reusing Abandoned Big-Box Superstores (2016)

https://99percentinvisible.org/article/ghost-boxes-reusing-abandoned-big-box-superstores-across-a...
1•dredmorbius•30m ago•1 comments

Factorio: More Planet Deliveries

https://factorio.com/blog/post/fff-443
2•ibobev•30m ago•0 comments

Cutlass Tutorial: Efficient GEMM Kernel Designs with Pipelining

https://research.colfax-intl.com/cutlass-tutorial-design-of-a-gemm-kernel/
2•skidrow•32m ago•0 comments

Extend Claude limits by offloading AI tasks to Neo

https://heyneo.com/claude-code
1•gauravvij137•32m ago•1 comments

P-Tau217 as a Reliable Blood-Based Marker of Alzheimer's Disease

https://pmc.ncbi.nlm.nih.gov/articles/PMC11351463/
1•brandonb•32m ago•0 comments

I restarted a 10 year old Xeon 174 times to delete 12 flags and gain 4 tps

https://point.free/blog/delete-12-flags/
3•zdw•33m ago•0 comments