| .. | .. |
|---|
| 126 | 126 | int tbuf_sz = 0, ret; |
|---|
| 127 | 127 | |
|---|
| 128 | 128 | tbuf_sz = (snic_trace_max_pages * PAGE_SIZE); |
|---|
| 129 | | - tbuf = vmalloc(tbuf_sz); |
|---|
| 129 | + tbuf = vzalloc(tbuf_sz); |
|---|
| 130 | 130 | if (!tbuf) { |
|---|
| 131 | 131 | SNIC_ERR("Failed to Allocate Trace Buffer Size. %d\n", tbuf_sz); |
|---|
| 132 | 132 | SNIC_ERR("Trace Facility not enabled.\n"); |
|---|
| .. | .. |
|---|
| 135 | 135 | return ret; |
|---|
| 136 | 136 | } |
|---|
| 137 | 137 | |
|---|
| 138 | | - memset(tbuf, 0, tbuf_sz); |
|---|
| 139 | 138 | trc->buf = (struct snic_trc_data *) tbuf; |
|---|
| 140 | 139 | spin_lock_init(&trc->lock); |
|---|
| 141 | 140 | |
|---|
| 142 | | - ret = snic_trc_debugfs_init(); |
|---|
| 143 | | - if (ret) { |
|---|
| 144 | | - SNIC_ERR("Failed to create Debugfs Files.\n"); |
|---|
| 145 | | - |
|---|
| 146 | | - goto error; |
|---|
| 147 | | - } |
|---|
| 141 | + snic_trc_debugfs_init(); |
|---|
| 148 | 142 | |
|---|
| 149 | 143 | trc->max_idx = (tbuf_sz / SNIC_TRC_ENTRY_SZ); |
|---|
| 150 | 144 | trc->rd_idx = trc->wr_idx = 0; |
|---|
| .. | .. |
|---|
| 152 | 146 | SNIC_INFO("Trace Facility Enabled.\n Trace Buffer SZ %lu Pages.\n", |
|---|
| 153 | 147 | tbuf_sz / PAGE_SIZE); |
|---|
| 154 | 148 | ret = 0; |
|---|
| 155 | | - |
|---|
| 156 | | - return ret; |
|---|
| 157 | | - |
|---|
| 158 | | -error: |
|---|
| 159 | | - snic_trc_free(); |
|---|
| 160 | 149 | |
|---|
| 161 | 150 | return ret; |
|---|
| 162 | 151 | } /* end of snic_trc_init */ |
|---|