# US 10,769,129 B2 · Efficient thread-safe tracking of function usage in distributed-processing systems

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,769,129 B2
- Document ID: US10769129B2
- Status: Granted
- Kind: B2
- Application number: 15/908,252
- Filed: 2018-02-28
- Published: 2019-04-04
- Granted: 2020-09-08
- Earliest claimed: 2017-09-29
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Pradip Kumar Pandey; Ira Foster Bindley; John David Holder; Brett Weston McGarity; Jason Michael Rice
- Web page: https://patentgrep.com/patent/US10769129B2

## CPC

- G06F 16/2343: {Locking methods, e.g. distributed locking or locking implementation details}
- G06F 11/302: {where the computing system component is a software system}
- G06F 11/3096: {wherein the means or processing minimize the use of computing system or of computing system component resources, e.g. non-intrusive monitoring which minimizes the probe effect: sniffing, intercepting, indirectly deriving the monitored data from other directly available data}
- G06F 16/2255: {Hash tables}
- G06F 16/284: {Relational databases}
- G06F 11/3409: {for performance assessment}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 2201/865: Monitoring of software
- G06F 2201/88: Monitoring involving counting
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques for tracking function usage in an enterprise system are provided. The techniques include executing a set of processes in one or more applications on one or more computer systems. Next, a set of threads in each process is used to track, in a hash table stored in memory on a computer system, calls to a set of functions by the process. A thread in the process is then used to update a data store containing usage data for the process with the tracked calls in the hash table.

## Claims

### Claim 1

A non-transitory computer readable medium comprising instructions which, when executed by one or more hardware processors, causes performance of operations comprising:
executing a set of processes in one or more applications on one or more computer systems; and
for each process in the set of processes:
executing a set of threads in the process that perform calls to a set of functions in a distributed-processing system;
when a thread in the set of threads performs a call to a function in the set of functions, identifying a hash entry representing the function in a hash table;
recording the call in the hash entry representing the function by incrementing a counter in the hash entry, wherein different hash entries respectively store counters for different functions among the set of functions; and
using a collector thread in the process to update a data store containing usage data for the process with values of the counters for the calls to the set of functions.

### Claim 2 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
aggregating the usage data for the process with additional usage data for other processes in the data store; and
including the aggregated usage data in a usage report for the set of processes.

### Claim 3 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
selecting the set of functions for tracking by the set of threads.

### Claim 4 (depends on 3)

The medium of claim 3, wherein selecting the set of functions for tracking by the set of threads comprises:
excluding an additional set of functions in the one or more applications from tracking by the set of threads.

### Claim 5 (depends on 1)

The medium of claim 1, wherein identifying the hash entry representing the function comprises:
creating a key from one or more attributes of the call; and
using a hash of the key as an index into a hash bucket in the hash table.

### Claim 6 (depends on 5)

The medium of claim 5, wherein recording the call in the hash entry representing the function comprises:
mapping the function to the hash bucket having one or more hash entries; and
using the one or more attributes to identify the hash entry, among the one or more hash entries, in the hash bucket.

### Claim 7 (depends on 5)

The medium of claim 5, wherein recording the call in the hash entry representing the function comprises:
acquiring a lock on the hash table; and
incrementing the counter in the hash entry during the lock.

### Claim 8 (depends on 5)

The medium of claim 5, wherein the one or more attributes comprise at least one of:
the function;
a module; and
an application.

### Claim 9 (depends on 1)

The medium of claim 1, wherein using the collector thread to update the data store with the counters for the calls to the set of functions in the hash entries of the hash table comprises:
after a lock on the hash table is acquired by the collector thread:
creating a new hash table for tracking the calls to the set of functions by the set of threads in the process; and
replacing a first pointer for accessing the hash table by the set of threads with a second pointer to the new hash table prior to releasing the lock; and
after the lock on the hash table is released by the thread, updating the data store with the counters in the hash entries of the hash table.

### Claim 10 (depends on 1)

The medium of claim 1, wherein using the collector thread to update the data store with the counters for the calls to the set of functions in the hash entries of the hash table comprises:
flushing the counters in the hash table to the data store after a batch-processing application in the one or more applications has finished executing a batch.

### Claim 11 (depends on 1)

The medium of claim 1, wherein the data store comprises a relational database.

### Claim 12 (depends on 11)

The medium of claim 11, wherein using the collector thread to update the data store with the counters for the calls to the set of functions in the hash entries of the hash table comprises:
updating a database row for the process with the counters for the calls in the hash table.

### Claim 13

A method, comprising:
executing a set of processes in one or more applications on one or more computer systems; and
for each process in the set of processes:
executing a set of threads in the process that perform calls to a set of functions in a distributed-processing system;
when a thread in the set of threads performs a call to a function in the set of functions, identifying a hash entry representing the function in a hash table;
recording the call in the hash entry representing the function by incrementing a counter in the hash entry, wherein different hash entries respectively store counters for different functions among the set of functions; and
using a collector thread in the process to update a data store containing usage data for the process with values of the counters for the calls to the set of functions.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
aggregating the usage data for the process with additional usage data for other processes in the data store; and
including the aggregated usage data in a usage report for the set of processes.

### Claim 15 (depends on 13)

The method of claim 13, wherein identifying the hash entry representing the function comprises:
creating a key from one or more attributes of the call; and
using a hash of the key as an index into a hash bucket in the hash table.

### Claim 16 (depends on 15)

The method of claim 15, wherein recording the call in the hash entry representing the function comprises:
using a concatenation of a function name, a module name, and an application name in the one or more attributes as an index to the hash entry in the hash bucket;
acquiring a lock on the hash table; and
incrementing the counter in the hash entry during the lock.

### Claim 17 (depends on 13)

The method of claim 13, wherein using the collector thread to update the data store with the counters for the calls to the set of functions in the hash entries of the hash table comprises:
after a lock on the hash table is acquired by the collector thread:
creating a new hash table for tracking the calls to the set of functions by the set of threads in the process; and
replacing a first pointer for accessing the hash table by the set of threads with a second pointer to the new hash table prior to releasing the lock; and
after the lock on the hash table is released by the thread, updating the data store with the counters in the hash entries of the hash table.

### Claim 18

An apparatus, comprising:
one or more processors; and
memory storing instructions that, when executed by the one or more processors, cause the apparatus to:
execute a set of processes in one or more applications on one or more computer systems; and
for each process in the set of processes:
execute a set of threads in the process that perform calls to a set of functions in a distributed-processing system;
when a thread in the set of threads performs a call to a function in the set of functions, identifying a hash entry representing the function in a hash table;
record the call in the hash entry representing the function by incrementing a counter in the hash entry, wherein different hash entries respectively store counters for different functions among the set of functions; and
use a collector thread in the process to update a data store containing usage data for the process with the values of the counters for the calls to the set of functions.

### Claim 19 (depends on 18)

The apparatus of claim 18, wherein the memory further stores instructions that, when executed by the one or more processors, cause the apparatus to:
aggregate the usage data for the process with additional usage data for other processes in the data store; and
include the aggregated usage data in a usage report for the set of processes.

### Claim 20 (depends on 1)

The medium of claim 1, wherein using the collector thread in the process to update the data store with the counters for the calls to the set of functions in the hash entries of the hash table comprises:
periodically flushing, to the data store, the counters in the hash table for an interactive application in the one or more applications.

### Claim 21 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
comparing a first counter from among the counters with a second counter from among the counters to determine a more heavily-used function among the set of functions.

### Claim 22 (depends on 21)

The medium of claim 21, wherein the operations further comprise:
determining the first counter to be the more heavily-used function between the first counter and the second counter;
determining that the first counter corresponds to a first function; and
selecting the first function for improvement.

### Claim 23 (depends on 13)

The method of claim 13, further comprising:
comparing a first counter from among the counters with a second counter from among the counters to determine a more heavily-used function among the set of functions.

### Claim 24 (depends on 23)

The method of claim 23, further comprising:
determining the first counter to be the more heavily-used function between the first counter and the second counter;
determining that the first counter corresponds to a first function; and
selecting the first function for improvement.

### Claim 25 (depends on 18)

The apparatus of claim 18, wherein the instructions further cause the apparatus to:
compare a first counter from among the counters with a second counter from among the counters to determine a more heavily-used function among the set of functions.

### Claim 26 (depends on 25)

The apparatus of claim 25, wherein the instructions further cause the apparatus to:
determine the first counter to be the more heavily-used function between the first counter and the second counter;
determine that the first counter corresponds to a first function; and
select the first function for improvement.
