Weirdly it worked for me on master, but not in monarch. I might have missed a clean between rebuilds.
I'll repost a new one Nicolas Le 12/13/2016 à 05:44 PM, Bill Fischofer a écrit : > Sorry about that. Yes, the file is missing: > > #include <inttypes.h> > > in the #include list, then it compiles and runs fine. Nicolas, can > you submit a v2? > > On Tue, Dec 13, 2016 at 8:51 AM, Maxim Uvarov <maxim.uva...@linaro.org> wrote: >> On 12/13/16 06:41, Bill Fischofer wrote: >>> On Tue, Dec 6, 2016 at 9:25 AM, Nicolas Morey-Chaisemartin >>> <nmo...@kalray.eu> wrote: >>>> Signed-off-by: Nicolas Morey-Chaisemartin <nmo...@kalray.eu> >>> Reviewed-by: Bill Fischofer <bill.fischo...@linaro.org> >>> >>>> --- >>>> >>>> This should be backported to monarch_lts too. However it requires an extra >>>> #include <inttypes.h> >>>> >>>> example/traffic_mgmt/odp_traffic_mgmt.c | 19 +++++++++++-------- >>>> 1 file changed, 11 insertions(+), 8 deletions(-) >>>> >>>> diff --git a/example/traffic_mgmt/odp_traffic_mgmt.c >>>> b/example/traffic_mgmt/odp_traffic_mgmt.c >>>> index c4f5356..94e208b 100644 >>>> --- a/example/traffic_mgmt/odp_traffic_mgmt.c >>>> +++ b/example/traffic_mgmt/odp_traffic_mgmt.c >>>> @@ -261,7 +261,8 @@ static uint32_t >>>> create_profile_set(profile_params_set_t *profile_params_set, >>>> if (name_idx == 0) >>>> snprintf(name, sizeof(name), "%s", base_name); >>>> else >>>> - snprintf(name, sizeof(name), "%s-%u", base_name, name_idx); >>>> + snprintf(name, sizeof(name), "%s-%" PRIu32, >>>> + base_name, name_idx); >>>> >>>> odp_tm_shaper_params_init(&shaper_params); >>>> shaper = >>>> &profile_params_set->shaper_params; >>>> @@ -289,7 +290,8 @@ static uint32_t >>>> create_profile_set(profile_params_set_t *profile_params_set, >>>> err_cnt++; >>>> >>>> for (color = 0; color < ODP_NUM_PACKET_COLORS; color++) { >>>> - snprintf(wred_name, sizeof(wred_name), "%s-%u", name, >>>> color); >>>> + snprintf(wred_name, sizeof(wred_name), "%s-%" PRIu32, >>>> + name, color); >> >> Bad review :) >> >> If possible please run odp-check tests on patches before sending. Or at >> least make check. >> >> Maxim. >> >> >>>> odp_tm_wred_params_init(&wred_params); >>>> wred = &profile_params_set->wred_params[color]; >>>> @@ -400,7 +402,7 @@ static int config_example_user(odp_tm_node_t >>>> cos_tm_node, >>>> profile_set->wred_profiles[2]; >>>> tm_node_params.level = 2; >>>> >>>> - snprintf(user_name, sizeof(user_name), "Subscriber-%u", user_num); >>>> + snprintf(user_name, sizeof(user_name), "Subscriber-%" PRIu32, >>>> user_num); >>>> user_tm_node = odp_tm_node_create(odp_tm_test, user_name, >>>> &tm_node_params); >>>> odp_tm_node_connect(user_tm_node, cos_tm_node); >>>> @@ -478,8 +480,8 @@ static int config_company_node(const char >>>> *company_name) >>>> tm_node_params.wred_profile[ODP_PACKET_RED] = >>>> profile_set->wred_profiles[ODP_PACKET_RED]; >>>> >>>> - snprintf(cos_node_name, sizeof(cos_node_name), >>>> "%s-Class-%u", >>>> - company_name, cos_idx); >>>> + snprintf(cos_node_name, sizeof(cos_node_name), >>>> + "%s-Class-%" PRIu32, company_name, cos_idx); >>>> cos_tm_node = odp_tm_node_create(odp_tm_test, >>>> cos_node_name, >>>> &tm_node_params); >>>> odp_tm_node_connect(cos_tm_node, company_tm_node); >>>> @@ -528,7 +530,7 @@ static int create_and_config_tm(void) >>>> odp_tm_test = odp_tm_create("TM test", &requirements, &egress); >>>> err_cnt = init_profile_sets(); >>>> if (err_cnt != 0) >>>> - printf("%s init_profile_sets encountered %u errors\n", >>>> + printf("%s init_profile_sets encountered %" PRIu32 " >>>> errors\n", >>>> __func__, err_cnt); >>>> >>>> config_company_node("TestCompany"); >>>> @@ -644,7 +646,7 @@ static int traffic_generator(uint32_t pkts_to_send) >>>> odp_atomic_inc_u32(&atomic_pkts_into_tm); >>>> } >>>> >>>> - printf("%s odp_tm_enq_errs=%u\n", __func__, odp_tm_enq_errs); >>>> + printf("%s odp_tm_enq_errs=%" PRIu32 "\n", __func__, >>>> odp_tm_enq_errs); >>>> >>>> /* Wait until the main traffic mgmt worker thread is idle and has >>>> no >>>> * outstanding events (i.e. no timers, empty work queue, etc), but >>>> @@ -786,7 +788,8 @@ int main(int argc, char *argv[]) >>>> >>>> pkts_into_tm = odp_atomic_load_u32(&atomic_pkts_into_tm); >>>> pkts_from_tm = odp_atomic_load_u32(&atomic_pkts_from_tm); >>>> - printf("pkts_into_tm=%u pkts_from_tm=%u\n", pkts_into_tm, >>>> pkts_from_tm); >>>> + printf("pkts_into_tm=%" PRIu32 " pkts_from_tm=%" PRIu32 "\n", >>>> + pkts_into_tm, pkts_from_tm); >>>> >>>> odp_tm_stats_print(odp_tm_test); >>>> return 0;