<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// @flow

import React from 'react';
import classNames from 'classnames';
import { filterCallNodePathByImplementation } from 'firefox-profiler/profile-logic/transforms';
import {
  getFuncNamesAndOriginsForPath,
  convertStackToCallNodePath,
} from 'firefox-profiler/profile-logic/profile-data';

import type {
  Thread,
  IndexIntoStackTable,
  ImplementationFilter,
} from 'firefox-profiler/types';

require('./Backtrace.css');

type Props = {|
  +thread: Thread,
  // Tooltips will want to only show a certain number of stacks, while the sidebars
  // can show all of the stacks.
  +maxStacks: number,
  +stackIndex: IndexIntoStackTable,
  +implementationFilter: ImplementationFilter,
|};

function Backtrace(props: Props) {
  const { stackIndex, thread, implementationFilter, maxStacks } = props;
  const callNodePath = filterCallNodePathByImplementation(
    thread,
    implementationFilter,<commit_msg>Change require to import in Backtrace.js<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// @flow

import React from 'react';
import classNames from 'classnames';
import { filterCallNodePathByImplementation } from 'firefox-profiler/profile-logic/transforms';
import {
  getFuncNamesAndOriginsForPath,
  convertStackToCallNodePath,
} from 'firefox-profiler/profile-logic/profile-data';

import type {
  Thread,
  IndexIntoStackTable,
  ImplementationFilter,
} from 'firefox-profiler/types';

import './Backtrace.css';

type Props = {|
  +thread: Thread,
  // Tooltips will want to only show a certain number of stacks, while the sidebars
  // can show all of the stacks.
  +maxStacks: number,
  +stackIndex: IndexIntoStackTable,
  +implementationFilter: ImplementationFilter,
|};

function Backtrace(props: Props) {
  const { stackIndex, thread, implementationFilter, maxStacks } = props;
  const callNodePath = filterCallNodePathByImplementation(
    thread,
    implementationFilter,
{'fraction_non_alphanumeric': 0.09584245076586433, 'fraction_numerical': 0.00350109409190372, 'mean_word_length': 4.602941176470588, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5305790', 'n_tokens_mistral': 693, 'n_tokens_neox': 678, 'n_words': 215}