Changeset 3631

Show
Ignore:
Timestamp:
05/16/08 13:34:59 (3 months ago)
Author:
br1
Message:

enclose node_print_message() calls in #ifdef IEEE80211_DEBUG
preprocessor directives to avoid this function beeing called
(and allocating stack space) when debugging is disabled.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • madwifi/trunk/net80211/ieee80211_node.c

    r3490 r3631  
    921921} 
    922922 
    923 static void node_print_message( 
     923#ifdef IEEE80211_DEBUG 
     924static void 
     925node_print_message( 
    924926                u_int32_t flags, 
    925                 int show_counter,  
     927                int show_counter, 
    926928                int refcnt_adjust, 
    927                 const struct ieee80211_node *ni,  
     929                const struct ieee80211_node *ni, 
    928930#ifdef IEEE80211_DEBUG_REFCNT 
    929931                const char* func1, int line1, 
     
    958960#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ 
    959961                        ni->ni_ic->ic_dev->name, 
    960                         ni->ni_vap->iv_dev->name,  
     962                        ni->ni_vap->iv_dev->name, 
    961963                        node_count, 
    962964#ifdef IEEE80211_DEBUG_REFCNT 
    963                         func1, line1,  
     965                        func1, line1, 
    964966#endif /* #ifdef IEEE80211_DEBUG_REFCNT */ 
    965                         func2, line2,  
     967                        func2, line2, 
    966968                        expanded_message, 
    967                         ni, MAC_ADDR(ni->ni_macaddr),  
     969                        ni, MAC_ADDR(ni->ni_macaddr), 
    968970                        ni->ni_table != NULL ? " in " : "", 
    969971                        ni->ni_table != NULL ? ni->ni_table->nt_name : "", 
     
    974976} 
    975977EXPORT_SYMBOL(node_print_message); 
     978#endif 
    976979 
    977980static void 
     
    11101113                ni->ni_ic = ic; 
    11111114                atomic_inc(&ni->ni_ic->ic_node_counter); 
     1115#ifdef IEEE80211_DEBUG 
    11121116                node_print_message(IEEE80211_MSG_NODE|IEEE80211_MSG_NODE_REF, 
    11131117                                   1 /* show counter */,  
     
    11191123                                   __func__, __LINE__,  
    11201124                                   "alloc" /* message */); 
     1125#endif 
    11211126        } else { 
    11221127                /* XXX msg */ 
     
    16681673 
    16691674        atomic_dec(&ni->ni_ic->ic_node_counter); 
     1675#ifdef IEEE80211_DEBUG 
    16701676        node_print_message(IEEE80211_MSG_NODE|IEEE80211_MSG_NODE_REF, 
    16711677                           1 /* show counter */,  
     
    16771683                           __func__, __LINE__,  
    16781684                           "free" /* message */); 
     1685#endif 
    16791686        if (vap->iv_aid_bitmap != NULL) 
    16801687                IEEE80211_AID_CLR(vap, ni->ni_associd); 
     
    24032410        } 
    24042411        if (atomic_read(&ni->ni_refcnt) < 1) { 
     2412#ifdef IEEE80211_DEBUG 
    24052413                node_print_message(IEEE80211_MSG_ANY, 
    24062414                                   0 /* show counter */,  
     
    24142422                                   "  No changes made." /* message */, 
    24152423                                   atomic_read(&ni->ni_refcnt)); 
     2424#endif 
    24162425                dump_stack(); 
    24172426                return ni; 
    24182427        } 
    24192428        atomic_inc(&ni->ni_refcnt); 
     2429#ifdef IEEE80211_DEBUG 
    24202430        node_print_message(IEEE80211_MSG_NODE_REF, 
    24212431                           0 /* show counter */,  
     
    24272437                           __func__, __LINE__,  
    24282438                           "ref" /* message */); 
     2439#endif 
    24292440        return ni; 
    24302441} 
     
    24552466        } 
    24562467        if (atomic_read(&ni->ni_refcnt) < 1) { 
     2468#ifdef IEEE80211_DEBUG 
    24572469                node_print_message(IEEE80211_MSG_ANY, 
    24582470                                   0 /* show counter */,  
     
    24662478                                   "  No changes made." /* message */, 
    24672479                                   atomic_read(&ni->ni_refcnt)); 
     2480#endif 
    24682481                dump_stack(); 
    24692482                return; 
    24702483        } 
    2471  
     2484#ifdef IEEE80211_DEBUG 
    24722485        node_print_message(IEEE80211_MSG_NODE_REF,  
    24732486                           0 /* show counter */,  
     
    24792492                           __func__, __LINE__,  
    24802493                           "unref" /* message */); 
     2494#endif 
    24812495 
    24822496        if (atomic_dec_and_test(&ni->ni_refcnt)) {