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
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.
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.
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!
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.
Looks good, thanks!
Merged into the new oprofileui git repo
verified 12-13-10