public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "jlebon at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug translator/15781] improve pass-2 function suggestions
Date: Thu, 12 Dec 2013 15:43:00 -0000	[thread overview]
Message-ID: <bug-15781-6586-4gNbcuR6Tx@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-15781-6586@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=15781

--- Comment #1 from Jonathan Lebon <jlebon at redhat dot com> ---
(In reply to Jonathan Lebon from comment #0)
> 1. Also suggest things for optional probes
> 
> This is also mentioned in the code in tapsets.cxx:7189. In a nutshell, if a
> probe contains optional probe points, then suggestions should also be
> offered for the optional ones if none of the probe points could be resolved.

Clarification on what this means:

probe kernel.function("not_a_func") { next }
   -- p2 fail, suggests alternatives to function name

probe kernel.function("not_a_func1"), kernel.function("not_a_func2") { next }
   -- p2 fail, suggests alternatives for both function names

probe kernel.function("not_a_func1")?, kernel.function("vfs_read") { next }
   -- works, does not suggest anything

probe kernel.function("not_a_func1")?, kernel.function("not_a_func2")? { next }
   -- works, does not suggest anything (assuming there are other probes in the
script, otherwise p2 fail with 'no probes found' and no suggestions)

probe kernel.function("not_a_func1")?, kernel.function("not_a_func2") { next }
   -- p2 fail, suggests alternatives for the non-optional probe point only

What we're describing in this PR is that in the last case, we should suggest
something for both probe points, regardless of optionality, because the whole
probe failed to resolved. We could also extend this to catch the before-last
case as well if it would result in a p2 fail.

This might be more trouble than it's worth, especially due to globby probes and
recursive calls, as well as performance issues, if the approach relies on
calculating suggestions for each probe point prematurely.

> 2. Improve levenshtein() algorithm
> 
> - Since we're only going to be printing MAXFUNCS functions, we can abort the
> calculations in levenshtein() at any point we know that the final score will
> be higher than the top MAXFUNCS functions already calculated. This is also
> mentioned in the code in util.cxx:1087.
> - An easy way to quickly improve performance is to compare the length of the
> strings right from the start. If their diff is larger than the max, then
> abort.

This was done in commit 59b11ea.

-- 
You are receiving this mail because:
You are the assignee for the bug.

  reply	other threads:[~2013-12-12 15:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 13:46 [Bug translator/15781] New: " jlebon at redhat dot com
2013-12-12 15:43 ` jlebon at redhat dot com [this message]
2014-01-16 23:19 ` [Bug translator/15781] " jlebon at redhat dot com
2014-01-22 21:10 ` jlebon at redhat dot com

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=bug-15781-6586-4gNbcuR6Tx@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.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).