hpievents client program does not prints the entity path for the events
which does not have the RDRs. The hpievents reads the entity path from
the RDR structure. 
For example: For hot swap events, RDRs are NOT pushed as part of the
events.
Since all the events will push the rptentry, the entity path can be
obtained from the rptentry instead of rdr.

Also, the hpi_cmd (hpi_shell) does not prints the entity path for the
events (when event is enabled). 

Entity path will help the user/tester to easily determine the resources
on which the event got generated.

The fix for these problems is given as patch for openhpi-2.10.0 below:

=================================Cut Here============================
--- openhpi-2.10.0/clients/hpievents.c
+++ openhpi-2.10.0/clients/hpievents.c
@@ -170,7 +170,6 @@

        printf( "Go and get the event\n");
        while (1) {
-               rdr.RdrType = SAHPI_NO_RECORD;

                rv = saHpiEventGet( sessionid, timeout, &event, &rdr,
&rptentry, NULL);
                if (rv != SA_OK) {
@@ -189,10 +188,7 @@
                        }
                        break;
                } else {
-                       if (rdr.RdrType == SAHPI_NO_RECORD)
-                               oh_print_event(&event, NULL, 4);
-                       else
-                               oh_print_event(&event, &rdr.Entity, 4);
+                        oh_print_event(&event,
&rptentry.ResourceEntity, 6);
                }
        }

--- openhpi-2.10.0/hpi_shell/session.c
+++ openhpi-2.10.0/hpi_shell/session.c
@@ -93,6 +93,7 @@

 static void* get_event(void *unused)
 {
+        SaHpiRptEntryT rptentry;
        SaHpiEventT     event;
        SaErrorT        rv;

@@ -107,7 +108,7 @@
                        memset(&event, 0xF, sizeof(event));
                        rv = saHpiEventGet(Domain->sessionId,
                                SAHPI_TIMEOUT_IMMEDIATE, &event,
-                               NULL, NULL, NULL);
+                               NULL, &rptentry, NULL);
                        if (rv != SA_OK ) {
                                break;
                        }
@@ -115,7 +116,7 @@
                                if (show_event_short)
                                        show_short_event(&event,
ui_print);
                                else
-                                       oh_print_event(&event, NULL, 1);
+                                       oh_print_event(&event,
&rptentry.ResourceEntity, 1);
                        }
                }/*the loop for retrieving event*/
                sleep(1);
=================================Cut Here============================

Regards,
Raghavendra.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel

Reply via email to