Bug 493 - OProfileServer spawning of oprofilectl failure will show through OProfile-viewer
Summary: OProfileServer spawning of oprofilectl failure will show through OProfile-viewer
Status: VERIFIED FIXED
Alias: None
Product: Eclipse Plugin
Classification: Yocto Project Subprojects
Component: eclipse-plugin (show other bugs)
Version: 1.0
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.0 M2
Assignee: Jessica
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2010-10-19 20:41 UTC by Jessica
Modified: 2011-01-07 17:31 UTC (History)
8 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified: Program Management
Documentation change: ---


Attachments
patch for adding CONFIG response check (569 bytes, text/plain)
2010-11-14 22:03 UTC, Lianhao Lu
no flags Details
patch for adding CONFIG response check (581 bytes, patch)
2010-12-02 18:08 UTC, Lianhao Lu
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jessica 2010-10-19 20:41:29 UTC
If OProfileServer ended in an endless loop of spawning of oprofilectl failures, tried to connect oprofile-viewer to the server, the oprofile-viewer will also be locked up by the endless failure
Comment 1 Lianhao Lu 2010-11-14 21:46:26 UTC
In a new fresh environment after booting, the client(oprofile-viewer) will do the following things to when user clicks the button connect to the target(oprofile-server):

1. connect the TCP socket
2. send the STATUS command
3. after get the reply of the STATUS command, send the CONFIG command
4. after get the reply of the CONFIG command, send the STATUS command again to check whether it needs to CONFIG again.

The endless loop occurs because when the client gets the response of the CONFIG command, it always sends the STATUS command no matter whether the CONFIG succeeds or not. If the CONFIG keeps failing the client will keep sending STATUS/CONFIG commands.
Comment 2 Lianhao Lu 2010-11-14 22:03:25 UTC
Created attachment 67 [details]
patch for adding CONFIG response check

This patch should be applied to oprofileUI svn rev 197.

It added the checking of the CONFIG response and made it only re-send the STATUS command for successful CONFIG.

The patch is put here temporarily until we get it upstreamed.
Comment 3 Joshua Lock - Disabled 2010-12-02 05:45:10 UTC
Hi,

Firstly can you please try and maintain the projects coding style when you create patches. Admittedly the project style isn't documented but it's quite easy to infer from reading the code. Compare the patched main_config_response():

void
main_config_response_cb (gboolean success, gchar *err_message)
{
  if (!success)
  {
    main_generic_error (err_message);
    main_set_state (OPUI_DISCONNECTING);
    client_disconnect (client);
  } else 
  {
    client_send_command_status (client);
    main_set_state(OPUI_CONNECTED_WAIT);
  }
}

to the main_connect_response_cb() from earlier in the file:

void
main_connect_response_cb (gboolean success, gchar *err_message)
{
  if (!success)
    {
      main_generic_error (err_message);
      main_set_state(OPUI_DISCONNECTED);
    } else {
      client_send_command_status (client);
      main_set_state(OPUI_CONNECTED_WAIT);
    }
}

Immediately we can see that the braces should be indented 2 spaces, the else statement be on the same line as the closing brace of the if and opening brace of the else and that there should be a space between the function name and opening bracket of a function call.

Once those stylistic fixes are made we can merge this patch, thanks!
Comment 4 Lianhao Lu 2010-12-02 18:08:42 UTC
Created attachment 73 [details]
patch for adding CONFIG response check

This patch should be applied to oprofileUI svn rev 197.

It added the checking of the CONFIG response and made it only re-send the
STATUS command for successful CONFIG.

It implied some coding stylistic fixes to the obsoleted patch.
Comment 5 Joshua Lock - Disabled 2010-12-03 04:58:34 UTC
Looks good, thanks!
Comment 6 Joshua Lock - Disabled 2010-12-10 07:39:40 UTC
Merged into the new oprofileui git repo
Comment 7 Jessica 2010-12-13 16:31:38 UTC
verified 12-13-10