Changeset a6b44a7


Ignore:
Timestamp:
09/14/15 11:33:05 (5 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
8b7f254
Parents:
b3dca4d
Message:

Don't fail trace_pstart if perpkt threads > DAG streams.

Instead, just cap the number of threads to match the number of streams we
have.

Added similar behaviour in the case where the URI contains more streams
than the number of threads.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dag25.c

    rd420777 ra6b44a7  
    694694        if (libtrace->perpkt_thread_count > max_streams) {
    695695                trace_set_err(libtrace, TRACE_ERR_BAD_FORMAT,
    696                               "trying to create too many threads (max is %u)",
     696                              "WARNING: DAG has only %u streams available, "
     697                              "capping total number of threads at this value.",
    697698                              max_streams);
    698                 iserror = 1;
    699                 goto cleanup;
    700         }
     699                libtrace->perpkt_thread_count = max_streams;
     700        }
    701701
    702702        /* Get the stream names from the uri */
    703703        if ((scan = strchr(libtrace->uridata, ',')) == NULL) {
    704704                trace_set_err(libtrace, TRACE_ERR_BAD_FORMAT,
    705                               "format uri doesn't specify the DAG streams");
     705                              "Format uri doesn't specify the DAG streams");
    706706                iserror = 1;
    707707                goto cleanup;
     
    715715                if (stream_count >= libtrace->perpkt_thread_count) {
    716716                        trace_set_err(libtrace, TRACE_ERR_BAD_FORMAT,
    717                                       "format uri specifies too many streams. "
    718                                       "Max is %u", max_streams);
    719                         iserror = 1;
    720                         goto cleanup;
    721                 }
     717                                      "WARNING: Format uri specifies too many "
     718                                      "streams. Maximum is %u, so only using "
     719                                      "the first %u from the uri.",
     720                                      max_streams);
     721                        break;
     722                }
    722723
    723724                /* Save the stream details */
Note: See TracChangeset for help on using the changeset viewer.