summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7fb17eb)
The possible TCD types are 0, 1, 2.
So the MAX is 2.
The count of the number of types is 3.
CFS_TCD_TYPE_MAX is 3 - obviously wrong.
So rename it to CFS_TCD_TYPE_CNT.
Also there are 2 places where "3" is used rather
than the macro - fix them.
Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ia4ce5fdb3225494f93d1eebd9fddfc15eb2b8316
Reviewed-on: https://review.whamcloud.com/39276
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
CFS_TCD_TYPE_PROC = 0,
CFS_TCD_TYPE_SOFTIRQ,
CFS_TCD_TYPE_IRQ,
CFS_TCD_TYPE_PROC = 0,
CFS_TCD_TYPE_SOFTIRQ,
CFS_TCD_TYPE_IRQ,
};
union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS] __cacheline_aligned;
};
union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS] __cacheline_aligned;
-char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX];
+char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_CNT];
char cfs_tracefile[TRACEFILE_NAME_SIZE];
long long cfs_tracefile_size = CFS_TRACEFILE_SIZE;
static struct tracefiled_ctl trace_tctl;
char cfs_tracefile[TRACEFILE_NAME_SIZE];
long long cfs_tracefile_size = CFS_TRACEFILE_SIZE;
static struct tracefiled_ctl trace_tctl;
int cfs_trace_lock_tcd(struct cfs_trace_cpu_data *tcd, int walking)
__acquires(&tcd->tcd_lock)
{
int cfs_trace_lock_tcd(struct cfs_trace_cpu_data *tcd, int walking)
__acquires(&tcd->tcd_lock)
{
- __LASSERT(tcd->tcd_type < CFS_TCD_TYPE_MAX);
+ __LASSERT(tcd->tcd_type < CFS_TCD_TYPE_CNT);
if (tcd->tcd_type == CFS_TCD_TYPE_IRQ)
spin_lock_irqsave(&tcd->tcd_lock, tcd->tcd_lock_flags);
else if (tcd->tcd_type == CFS_TCD_TYPE_SOFTIRQ)
if (tcd->tcd_type == CFS_TCD_TYPE_IRQ)
spin_lock_irqsave(&tcd->tcd_lock, tcd->tcd_lock_flags);
else if (tcd->tcd_type == CFS_TCD_TYPE_SOFTIRQ)
void cfs_trace_unlock_tcd(struct cfs_trace_cpu_data *tcd, int walking)
__releases(&tcd->tcd_lock)
{
void cfs_trace_unlock_tcd(struct cfs_trace_cpu_data *tcd, int walking)
__releases(&tcd->tcd_lock)
{
- __LASSERT(tcd->tcd_type < CFS_TCD_TYPE_MAX);
+ __LASSERT(tcd->tcd_type < CFS_TCD_TYPE_CNT);
if (tcd->tcd_type == CFS_TCD_TYPE_IRQ)
spin_unlock_irqrestore(&tcd->tcd_lock, tcd->tcd_lock_flags);
else if (tcd->tcd_type == CFS_TCD_TYPE_SOFTIRQ)
if (tcd->tcd_type == CFS_TCD_TYPE_IRQ)
spin_unlock_irqrestore(&tcd->tcd_lock, tcd->tcd_lock_flags);
else if (tcd->tcd_type == CFS_TCD_TYPE_SOFTIRQ)
}
/* percents to share the total debug memory for each type */
}
/* percents to share the total debug memory for each type */
-static unsigned int pages_factor[CFS_TCD_TYPE_MAX] = {
+static unsigned int pages_factor[CFS_TCD_TYPE_CNT] = {
80, /* 80% pages for CFS_TCD_TYPE_PROC */
10, /* 10% pages for CFS_TCD_TYPE_SOFTIRQ */
10 /* 10% pages for CFS_TCD_TYPE_IRQ */
80, /* 80% pages for CFS_TCD_TYPE_PROC */
10, /* 10% pages for CFS_TCD_TYPE_SOFTIRQ */
10 /* 10% pages for CFS_TCD_TYPE_IRQ */
/* initialize trace_data */
memset(cfs_trace_data, 0, sizeof(cfs_trace_data));
/* initialize trace_data */
memset(cfs_trace_data, 0, sizeof(cfs_trace_data));
- for (i = 0; i < CFS_TCD_TYPE_MAX; i++) {
+ for (i = 0; i < CFS_TCD_TYPE_CNT; i++) {
cfs_trace_data[i] =
kmalloc_array(num_possible_cpus(),
sizeof(union cfs_trace_data_union),
cfs_trace_data[i] =
kmalloc_array(num_possible_cpus(),
sizeof(union cfs_trace_data_union),