Lines Matching refs:table
24 // | Thread names table |
26 // | Thread TID table |
28 // | Thread PID table |
30 // | Counter names table |
47 // the rows and columns of the table to particular threads, locking is
51 // shared-memory table only, and is used when we create new counters (e.g.
53 // data from the table does not require any locking at the shared memory
56 // Each process which accesses the table will create a StatsTable object.
57 // The StatsTable maintains a hash table of the existing counters in the
58 // table for faster lookup. Since the hash table is process specific,
60 // de-allocating from the hash table. (Counters are dynamically added,
70 // file, and so that we can identify our table.
73 // The name for un-named counters and threads in the table.
102 static Internal* New(const StatsTable::TableIdentifier& table,
147 // Create or open the SharedMemory used by the stats table.
149 const StatsTable::TableIdentifier& table,
152 // Initializes the table on first access. Sets header values
173 const StatsTable::TableIdentifier& table,
177 scoped_ptr<SharedMemory> shared_memory(CreateSharedMemory(table, size));
187 // If the version does not match, then assume the table needs
192 // We have a valid table, so compute our pointers.
200 const StatsTable::TableIdentifier& table,
203 // Check for existing table.
204 if (table.fd != -1)
205 return new SharedMemory(table, false);
214 if (table.empty()) {
215 // Create an anonymous table.
219 // Create a named table for sharing between processes.
220 if (!shared_memory->CreateNamedDeprecated(table, true, size))
278 // thread exits and return the table slot.
283 StatsTable* table;
287 // We keep a singleton table which can be easily accessed.
290 StatsTable::StatsTable(const TableIdentifier& table,
303 internal_ = Internal::New(table, table_size, max_threads, max_counters);
310 // Before we tear down our copy of the table, be sure to
321 // If we are the global table, unregister ourselves.
357 // We have space, so consume a column in the table.
369 data->table = this;
380 // We intentionally do not lock the table during the operation.
474 StatsTable *table = StatsTable::current();
475 if (!table)
480 int slot = table->GetSlot();
481 if (!slot && !(slot = table->RegisterThread(std::string())))
486 int counter = table->FindCounter(str_name);
488 // Now we can find the location in the table.
489 return table->GetLocation(counter, slot);
516 DCHECK(tls_data->table);
517 tls_data->table->UnregisterThread(tls_data);
540 return 0; // The table is full.
603 DCHECK_EQ(data->table, this);