Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Elf Profiling and potential improvements
  • From: Matthew Khouzam <matthew.khouzam@xxxxxxxxxxxx>
  • Date: Fri, 3 Apr 2020 03:28:02 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; 1; spf=pass; dmarc=pass action=none; dkim=pass; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed;; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dg1Qyy7//tZ9VC1QpyzSvIcsn+QSJQxQ0REAnsqEGss=; b=hQQd0f7j0e0QuN+4GGGbj9sWuCjix1X78fSnWKcU6knEZB1KNJh/qXJBMXVQpXGNyeRrTtRMW5TXLO0ZB6WiJ5SmXuQzU4KaLzAvS3paNYPP2bHb14nTAbn+DPmmDCozVIgfU8IaX9zvsL1P0iDejzHU2/kqQU287Fpxfmhng7akA3FuEXyg/rmyJi+2j3fU5a3Rh1AqkinLS8Fc6MEGsq3Gf1IyTtgdFjbmPLpUaXWJRu2mYY8ebNSEhk1bQNP39g6d6oj9Q8u+J/ZtUuidYZ8MdD5i7vfZWHsBLVeRocwxCulZhk8HE2pb/3Zn27WhCXyzM+YVoW1iNdsPMIqReQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901;; cv=none; b=ZZBF5b0yZKMrecrDuo5YR8UxzPdwz5O0hJxIgZK0zT2Oi/5M5iDXx5sCEV9a+cyiEbUwGGlk2OrSyTMMKefXOp8IEBfeMcuTQUG+ht1MIt3NNgvNmU9nZxtItoCwqKYsO5nVGirZWCkOOcl+UK5rrQ/+hPY4ndxoY/er55IiLqVXM3NinlRh7C2qaDJmjulsCBcFFOZlxfXihHUtNOtHa0Thd1dx9R5ctXFJ2GsOU8eC78f3MK7nl9xXquYAh6JYcsiBJOQ77cpPgE+cpzu68ZGunrY56isSMAVeCwHoYi4Wjx4HMWc8vPoA76XyxB+RhjFuLME7qyKlG4zDOIkJkg==
  • Delivered-to: cdt-dev@xxxxxxxxxxx
  • List-archive: <>
  • List-help: <>
  • List-subscribe: <>, <>
  • List-unsubscribe: <>, <>
  • Thread-index: AQHWCWTw0dUMW5LZIkOT37/0B3ryWQ==
  • Thread-topic: Elf Profiling and potential improvements

Hello world,

I have been profiling CDT's elf parser, and have found some opportunities. Now please understand, I was torture testing it to make sure it works with Trace Compass for some upcoming feature ideas I was going to pitch, I'm just hoping to help more than myself with this effort.

I was testing an embedded system with a 1 GB executable. Why? in case someone else does that. Elf parsing works well and scaled OK. But the memory requirements are a bit high.

Basically the parser loads every symbol into an array then sorts it. See image below for a "smaller" test with 60k functions.

I have made a quick patch to allow iteration through the elf file instead of reading it all in one block. This is useful when you want to make a map of symbols to trace segments. 

I have questions about the API of that file though, it has many public/protected fields that kind of limit its modify-ability, what would be the CDT friendly way to improve it?

My endgame would be to have an iterator on the executable that gives all the symbols, not necessarily in order so an extender can use it with more degrees of freedom.



Matthew Khouzam    
Software Developer
8275 Route Transcanadienne
H4S 0B6,Saint-Laurent, Quebec
Our commitment to Technology for Good and Diversity and Inclusion contributes to positive change.
Follow us on: Facebook LinkedIn Twitter

Legal entity:ERICSSON AB registration number 556056-6258, registered office in Stockholm
This communication is confidential. Our email terms:

Back to the top