Changeset 6854


Ignore:
Timestamp:
Nov 5, 2009, 6:58:38 PM (14 years ago)
Author:
mies
Message:

added additional debug info on error in base overlay

Location:
source/ariba/overlay
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/overlay/BaseOverlay.cpp

    r6851 r6854  
    567567        if (!ldr->up && !ignore_down) {
    568568                logging_error("Can not send message. Link not up:" << ldr );
     569                logging_error("DEBUG_INFO: " << debugInformation() );
    569570                return -1;
    570571        }
     
    578579                if (ld==NULL) {
    579580                        logging_error("No relay path found to link " << ldr );
     581                        logging_error("DEBUG_INFO: " << debugInformation() );
    580582                        return -1;
    581583                }
     
    22392241}
    22402242
     2243std::string BaseOverlay::debugInformation() {
     2244        std::stringstream s;
     2245        int i=0;
     2246
     2247        // dump overlay information
     2248        s << "--- overlay information ----------------------" << endl;
     2249        s << overlayInterface->debugInformation() << endl;
     2250        s << "----------------------------------------------" << endl;
     2251
     2252        // dump link state
     2253        s << "--- link state -------------------------------" << endl;
     2254        BOOST_FOREACH( LinkDescriptor* ld, links ) {
     2255                s << "link " << i << ": " << ld << endl;
     2256                i++;
     2257        }
     2258        s << endl;
     2259
     2260        return s.str();
     2261}
    22412262
    22422263}} // namespace ariba, overlay
  • source/ariba/overlay/BaseOverlay.h

    r6835 r6854  
    506506        // misc --------------------------------------------------------------------
    507507
     508        std::string debugInformation();
     509
    508510        /**
    509511         * nodes with pending joines. TODO: should be cleaned every
  • source/ariba/overlay/modules/OverlayInterface.cpp

    r3718 r6854  
    8383}
    8484
     85std::string OverlayInterface::debugInformation() const {
     86        return "No Information Available.";
     87}
     88
    8589const OverlayParameterSet& OverlayInterface::getParameters() const {
    8690        return parameters;
  • source/ariba/overlay/modules/OverlayInterface.h

    r6266 r6854  
    173173        const OverlayParameterSet& getParameters() const;
    174174
     175        virtual std::string debugInformation() const;
     176
    175177protected:
    176178        /// Reference to an active base overlay
  • source/ariba/overlay/modules/chord/Chord.cpp

    r6832 r6854  
    473473}
    474474
     475/// @see OverlayInterface.h
     476std::string Chord::debugInformation() const {
     477        std::ostringstream s;
     478        s << "protocol   : Chord" << endl;
     479        s << "node_id    : " << nodeid.toString() << endl;
     480        s << "predecessor: " << (table->get_predesessor()==NULL? "<none>" :
     481                table->get_predesessor()->toString()) << endl;
     482        s << "successor  : " << (table->get_successor()==NULL? "<none>" :
     483                table->get_successor()->toString()) << endl;
     484        s << "nodes: " << endl;
     485        for (size_t i = 0; i < table->size(); i++) {
     486                route_item* it = (*table)[i];
     487                if (it->ref_count != 0 && !it->info.isUnspecified()) {
     488                        s << it->id.toString().substr(0,6)
     489                          << " using " << it->info.toString().substr(0,6) << endl;
     490                }
     491        }
     492        return s.str();
     493}
     494
     495
     496
    475497}} // namespace ariba, overlay
  • source/ariba/overlay/modules/chord/Chord.h

    r6266 r6854  
    138138                        const LinkID& lnk = LinkID::UNSPECIFIED);
    139139
     140        /// @see OverlayInterface.h
     141        virtual std::string debugInformation() const;
     142
    140143        /// @see Timer.h
    141144        virtual void eventFunction();
Note: See TracChangeset for help on using the changeset viewer.