public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Sasha Da Rocha Pinheiro <darochapinhe@wisc.edu>
To: Mark Wielaard <mark@klomp.org>
Cc: "elfutils-devel@sourceware.org" <elfutils-devel@sourceware.org>
Subject: Re: File index given line (libdw)
Date: Sat, 15 Jul 2017 01:22:00 -0000	[thread overview]
Message-ID: <DM2PR06MB272B25E498191D876E138D4A6A20@DM2PR06MB272.namprd06.prod.outlook.com> (raw)
In-Reply-To: <1500026625.14595.238.camel@klomp.org>

Hi Mark,

>But why do you want to do that?

Performance and save memory space.


>If we would add int dwarf_line_index (Dwarf_Line *line, size_t *idx) how
>exactly would you use it?

I would get idx and save it in my data structure so I don't have to save the file name repeatedly for each line.


>What would be a good testcase for this new functionality?
This new function would behave similar to:

int dwarf_lineno (Dwarf_Line *line, int *linep)
{
  if (line == NULL)
    return -1;

  *linep =  line->line;

  return 0;
}

But would get line->file instead of line->line;
This way, since I already got the files previously, I now can refer to some line file source by its id.


>A small example program would help to see what the exact semantics
>should be.
How it's currently being done :

1. Dwarf_Files dfs <- dwarf_getsrcfiles
2. for each file in dfs get name (with dwarf_filesrc) -> save in vector filenames
3. Dwarf_Lines dls <- dwarf_getsrclines
4. for each line in dls get file name and "search this name in vector filenames"

We want to eliminate the "search this name in vector filenames", to make it from L F log(F) to L, by getting the index and consulting the file name of a line in the vector filenames directly.

Regards,
Sasha






  reply	other threads:[~2017-07-15  1:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13  0:25 Sasha Da Rocha Pinheiro
2017-07-13  9:11 ` Mark Wielaard
2017-07-13 17:33   ` Sasha Da Rocha Pinheiro
2017-07-14 10:03     ` Mark Wielaard
2017-07-15  1:22       ` Sasha Da Rocha Pinheiro [this message]
2017-07-15 13:56         ` Mark Wielaard
2017-07-17  4:11           ` Sasha Da Rocha Pinheiro
2017-07-17 13:04             ` Mark Wielaard
2017-07-17 17:28               ` Sasha Da Rocha Pinheiro
2017-07-21 19:29                 ` Mark Wielaard
2017-07-26 21:25                   ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM2PR06MB272B25E498191D876E138D4A6A20@DM2PR06MB272.namprd06.prod.outlook.com \
    --to=darochapinhe@wisc.edu \
    --cc=elfutils-devel@sourceware.org \
    --cc=mark@klomp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).