[ofa-general] Re: [PATCH] opensm/osm_inform.c: For traps 64-67, use GID in DataDetails in log messages

Hal Rosenstock hal.rosenstock at gmail.com
Wed Jun 17 13:36:24 PDT 2009


On Wed, Jun 17, 2009 at 12:46 PM, Sasha Khapyorsky<sashak at voltaire.com> wrote:
> On 09:40 Wed 17 Jun     , Hal Rosenstock wrote:
>>
>> Issuer GID and LID are uninteresting for SM generated notices
>>
>> Signed-off-by: Hal Rosenstock <hal.rosenstock at gmail.com>
>> ---
>> diff --git a/opensm/opensm/osm_inform.c b/opensm/opensm/osm_inform.c
>> index 990f1e0..43676c2 100644
>> --- a/opensm/opensm/osm_inform.c
>> +++ b/opensm/opensm/osm_inform.c
>> @@ -561,15 +561,29 @@ ib_api_status_t osm_report_notice(IN osm_log_t * p_log, IN osm_subn_t * p_subn,
>>
>>       /* an official Event information log */
>>       if (ib_notice_is_generic(p_ntc))
>> -             OSM_LOG(p_log, OSM_LOG_INFO,
>> -                     "Reporting Generic Notice type:%u num:%u (%s)"
>> -                     " from LID:%u GID:%s\n",
>> -                     ib_notice_get_type(p_ntc),
>> -                     cl_ntoh16(p_ntc->g_or_v.generic.trap_num),
>> -                     ib_get_trap_str(p_ntc->g_or_v.generic.trap_num),
>> -                     cl_ntoh16(p_ntc->issuer_lid),
>> -                     inet_ntop(AF_INET6, p_ntc->issuer_gid.raw, gid_str,
>> -                               sizeof gid_str));
>> +             if ((p_ntc->g_or_v.generic.trap_num == CL_HTON16(64)) ||
>> +                 (p_ntc->g_or_v.generic.trap_num == CL_HTON16(65)) ||
>> +                 (p_ntc->g_or_v.generic.trap_num == CL_HTON16(66)) ||
>> +                 (p_ntc->g_or_v.generic.trap_num == CL_HTON16(67)))
>> +                     OSM_LOG(p_log, OSM_LOG_INFO,
>> +                             "Reporting Generic Notice type:%u num:%u (%s)"
>> +                             " GID:%s\n",
>> +                             ib_notice_get_type(p_ntc),
>> +                             cl_ntoh16(p_ntc->g_or_v.generic.trap_num),
>> +                             ib_get_trap_str(p_ntc->g_or_v.generic.trap_num),
>> +                             inet_ntop(AF_INET6,
>> +                                       p_ntc->data_details.ntc_64_67.gid.raw,
>> +                                       gid_str, sizeof gid_str));
>> +             else
>> +                     OSM_LOG(p_log, OSM_LOG_INFO,
>> +                             "Reporting Generic Notice type:%u num:%u (%s)"
>> +                             " from LID:%u GID:%s\n",
>> +                             ib_notice_get_type(p_ntc),
>> +                             cl_ntoh16(p_ntc->g_or_v.generic.trap_num),
>> +                             ib_get_trap_str(p_ntc->g_or_v.generic.trap_num),
>> +                             cl_ntoh16(p_ntc->issuer_lid),
>> +                             inet_ntop(AF_INET6, p_ntc->issuer_gid.raw,
>> +                                       gid_str, sizeof gid_str));
>
> Maybe, but it seems easier for me to have unified log here (which is
> macro which will be filtered out when log level is lower) than add
> additional "if/else".

Not sure what you mean by "unified log".

-- Hal

> Sasha
> _______________________________________________
> general mailing list
> general at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
>
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
>


More information about the general mailing list