Ignore:
Timestamp:
Feb 14, 2018, 3:40:19 PM (6 years ago)
Author:
alain
Message:

blip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/fs/devfs.c

    r430 r433  
    2828#include <printk.h>
    2929#include <chdev.h>
     30#include <thread.h>
    3031#include <dev_txt.h>
    3132#include <cluster.h>
     
    8687    error_t  error;
    8788
    88     devfs_dmsg("\n[DBG] %s : enter in cluster %x\n",
    89                __FUNCTION__ , local_cxy );
     89#if CONFIG_DEBUG_DEVFS_INIT
     90uint32_t cycle = (uint32_t)hal_get_cycles();
     91if( CONFIG_DEBUG_DEVFS_INIT < cycle )
     92printk("\n[DBG] %s : thread %x enter at cycle %d\n",
     93__FUNCTION__ , CURRENT_THREAD , cycle );
     94#endif
    9095
    9196    // creates DEVFS "dev" inode in cluster IO
     
    100105    assert( (error == 0) , __FUNCTION__ , "cannot create <dev>\n" );
    101106
    102     devfs_dmsg("\n[DBG] %s : <dev> created in cluster %x\n",
    103                __FUNCTION__ , local_cxy );
    104 
    105107    // create DEVFS "external" inode in cluster IO
    106108    error = vfs_add_child_in_parent( LOCAL_CLUSTER->io_cxy,
     
    114116    assert( (error == 0) , __FUNCTION__ , "cannot create <external>\n" );
    115117
    116     devfs_dmsg("\n[DBG] %s : <external> created in cluster %x\n",
    117                __FUNCTION__ , local_cxy );
     118#if CONFIG_DEBUG_DEVFS_INIT
     119cycle = (uint32_t)hal_get_cycles();
     120if( CONFIG_DEBUG_DEVFS_INIT < cycle )
     121printk("\n[DBG] %s : thread %x exit at cycle %d\n",
     122__FUNCTION__ , CURRENT_THREAD , cycle );
     123#endif
     124
    118125}
    119126
     
    129136    xptr_t        inode_xp;
    130137    uint32_t      channel;
     138
     139#if CONFIG_DEBUG_DEVFS_INIT
     140uint32_t cycle = (uint32_t)hal_get_cycles();
     141if( CONFIG_DEBUG_DEVFS_INIT < cycle )
     142printk("\n[DBG] %s : thread %x enter at cycle %d\n",
     143__FUNCTION__ , CURRENT_THREAD , cycle );
     144#endif
    131145
    132146    // create "internal" directory linked to "dev"
     
    140154                             devfs_internal_inode_xp );
    141155
    142 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",
    143 __FUNCTION__ , node_name , local_cxy );
    144 
    145156    // create MMC chdev inode
    146157    chdev_xp  = chdev_dir.mmc[local_cxy];
     
    155166                                 GET_PTR( chdev_xp ),
    156167                                 &inode_xp );
    157 
    158 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",
    159 __FUNCTION__ , chdev_ptr->name , local_cxy );
    160 
    161168    }
    162169
     
    175182                                     GET_PTR( chdev_xp ),
    176183                                     &inode_xp );
    177 
    178 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",
    179 __FUNCTION__ , chdev_ptr->name , local_cxy );
    180 
    181184        }
    182185    }
     
    197200                                     GET_PTR( chdev_xp ),
    198201                                     &inode_xp );
    199 
    200 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",
    201 __FUNCTION__ , chdev_ptr->name , local_cxy );
    202 
    203202        }
    204203    }
     
    219218                                     GET_PTR( chdev_xp ),
    220219                                     &inode_xp );
    221 
    222 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",
    223 __FUNCTION__ , chdev_ptr->name , local_cxy );
    224 
    225220        }
    226221    }
     
    243238                                         GET_PTR( chdev_xp ),
    244239                                         &inode_xp );
    245 
    246 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",
    247 __FUNCTION__ , chdev_ptr->name , local_cxy );
    248 
    249240            }
    250241        }
     
    268259                                         GET_PTR( chdev_xp ),
    269260                                         &inode_xp );
    270 
    271 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",
    272 __FUNCTION__ , chdev_ptr->name , local_cxy );
    273 
    274261            }
    275262        }
     
    293280                                         GET_PTR( chdev_xp ),
    294281                                         &inode_xp );
    295 
    296 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",
    297 __FUNCTION__ , chdev_ptr->name , local_cxy );
    298 
    299282            }
    300283        }
     
    318301                                         GET_PTR( chdev_xp ),
    319302                                         &inode_xp );
    320 
    321 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",
    322 __FUNCTION__ , chdev_ptr->name , local_cxy );
    323 
    324303            }
    325304        }
     
    343322                                         GET_PTR( chdev_xp ),
    344323                                         &inode_xp );
    345 
    346 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",
    347 __FUNCTION__ , chdev_ptr->name , local_cxy );
    348 
    349324            }
    350325        }
     
    368343                                         GET_PTR( chdev_xp ),
    369344                                         &inode_xp );
    370 
    371 devfs_dmsg("\n[DBG] %s : created <%s> inode in cluster %x\n",
    372 __FUNCTION__ , chdev_ptr->name , local_cxy );
    373 
    374             }
    375         }
    376     }
     345            }
     346        }
     347    }
     348
     349#if CONFIG_DEBUG_DEVFS_INIT
     350cycle = (uint32_t)hal_get_cycles();
     351if( CONFIG_DEBUG_DEVFS_INIT < cycle )
     352printk("\n[DBG] %s : thread %x exit at cycle %d\n",
     353__FUNCTION__ , CURRENT_THREAD , cycle );
     354#endif
     355
    377356}  // end devfs_local_init()
    378357
     
    396375    char               k_buf[CONFIG_TXT_KBUF_SIZE];  // local kernel buffer
    397376
    398 devfs_dmsg("\n[DBG] %s enter / cycle %d\n",
    399 __FUNCTION__ , hal_time_stamp() );
     377#if CONFIG_DEBUG_DEVFS_MOVE
     378uint32_t cycle = (uint32_t)hal_get_cycles();
     379if( CONFIG_DEBUG_DEVFS_MOVE < cycle )
     380printk("\n[DBG] %s : thread %x enter / to_mem %d / cycle %d\n",
     381__FUNCTION__ , CURRENT_THREAD , to_buffer , cycle );
     382#endif
    400383
    401384#if CONFIG_READ_DEBUG
     
    426409                if( error )
    427410                {
    428 
    429 devfs_dmsg("\n[DBG] %s exit error / cycle %d\n",
    430 __FUNCTION__ , hal_time_stamp() );
    431 
    432411                    return -1;
    433412                }
     
    438417             }
    439418
     419#if CONFIG_DEBUG_DEVFS_MOVE
     420cycle = (uint32_t)hal_get_cycles();
     421if( CONFIG_DEBUG_DEVFS_MOVE < cycle )
     422printk("\n[DBG] %s : thread %x exit / to_mem %d / cycle %d\n",
     423__FUNCTION__ , CURRENT_THREAD , to_buffer / cycle );
     424#endif
     425
    440426#if CONFIG_READ_DEBUG
    441427exit_devfs_move = hal_time_stamp();
    442428#endif
    443 
    444 devfs_dmsg("\n[DBG] %s exit success / size = %d / cycle %d\n",
    445 __FUNCTION__ , size , hal_time_stamp() );
    446 
    447429            return size;
    448430        }
     
    454436            if( error )
    455437            {
    456 
    457 devfs_dmsg("\n[DBG] %s exit error / cycle %d\n",
    458 __FUNCTION__ , hal_time_stamp() );
    459 
    460438                return -1;
    461439            }
     
    463441            {
    464442
    465 devfs_dmsg("\n[DBG] %s exit success / size = %d / cycle %d\n",
    466 __FUNCTION__ , size , hal_time_stamp() );
     443#if CONFIG_DEBUG_DEVFS_MOVE
     444cycle = (uint32_t)hal_get_cycles();
     445if( CONFIG_DEBUG_DEVFS_MOVE < cycle )
     446printk("\n[DBG] %s : thread %x exit / to_mem %d / cycle %d\n",
     447__FUNCTION__ , CURRENT_THREAD , to_buffer / cycle );
     448#endif
    467449
    468450                return size;
     
    477459        return -1;
    478460    }
     461
    479462}  // end devfs_user_move()
    480463
Note: See TracChangeset for help on using the changeset viewer.